Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. # Requires mod_expires to be enabled.
  2. <IfModule mod_expires.c>
  3. # Enable expirations.
  4. ExpiresActive On
  5.  
  6. # Cache all files for 2 weeks after access (A).
  7. ExpiresDefault A1209600
  8.  
  9. # Do not cache dynamically generated pages.
  10. ExpiresByType text/html A1
  11.  
  12. # But static HTML files can use the 2 week cache also.
  13. <IfModule mod_headers.c>
  14. <FilesMatch "\.(html?)$">
  15. Header set Cache-Control max-age=1209600
  16. </FilesMatch>
  17. </IfModule>
  18. </IfModule>
  19.  
  20. <IfModule mod_headers.c>
  21. # Set E-tags for other files based on modified time and size. We exclude the
  22. # INode here because we use multiple web-servers that will assign a different
  23. # INode for anything not on the NFS mount.
  24. <LocationMatch "^/sites/">
  25. # Files within modules and themes have a 30 second "internal" lifetime
  26. # before they are retrieved and updated by Varnish again.
  27. Header append Cache-Control s-maxage=30
  28. # Assemble the ETag based on modified time and file size, but not INode.
  29. FileETag MTime Size
  30. </LocationMatch>
  31.  
  32. # Set E-tags for files in the file directory. INode can be used in the hash
  33. # here because all files are hosted on an NFS mount.
  34. <LocationMatch "^/files/">
  35. # Assemble the standard ETag for shared NFS files.
  36. FileETag INode MTime Size
  37. </LocationMatch>
  38. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement