vhost_expires.j2 677 B

1234567891011121314151617181920212223242526272829303132
  1. {% if ansible_prolog -%}
  2. {% from 'templates/ansible/prolog.j2' import prolog with context %}
  3. {{ prolog() }}
  4. {% endif -%}
  5. #
  6. # Expirerules for static content
  7. #
  8. # cache.appcache, your document html and data
  9. location ~* \.(?:manifest|appcache|html?|xml|json)$ {
  10. expires -1;
  11. }
  12. # Feeds
  13. location ~* \.(?:rss|atom)$ {
  14. expires 1h;
  15. add_header Cache-Control "public";
  16. }
  17. # Media: images, icons, video, audio, HTC
  18. location ~* \.(?:jpg|jpeg|gif|png|ico|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
  19. expires 1M;
  20. access_log off;
  21. add_header Cache-Control "public";
  22. }
  23. # CSS and Javascript
  24. location ~* \.(?:css|js)$ {
  25. expires 2M;
  26. access_log off;
  27. add_header Cache-Control "public";
  28. }