Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Requires mod_expires to be enabled.
- <IfModule mod_expires.c>
- # Enable expirations.
- ExpiresActive On
- # Cache all files for 2 weeks after access (A).
- ExpiresDefault A1209600
- # Do not cache dynamically generated pages.
- ExpiresByType text/html A1
- # But static HTML files can use the 2 week cache also.
- <IfModule mod_headers.c>
- <FilesMatch "\.(html?)$">
- Header set Cache-Control max-age=1209600
- </FilesMatch>
- </IfModule>
- </IfModule>
- <IfModule mod_headers.c>
- # Set E-tags for other files based on modified time and size. We exclude the
- # INode here because we use multiple web-servers that will assign a different
- # INode for anything not on the NFS mount.
- <LocationMatch "^/sites/">
- # Files within modules and themes have a 30 second "internal" lifetime
- # before they are retrieved and updated by Varnish again.
- Header append Cache-Control s-maxage=30
- # Assemble the ETag based on modified time and file size, but not INode.
- FileETag MTime Size
- </LocationMatch>
- # Set E-tags for files in the file directory. INode can be used in the hash
- # here because all files are hosted on an NFS mount.
- <LocationMatch "^/files/">
- # Assemble the standard ETag for shared NFS files.
- FileETag INode MTime Size
- </LocationMatch>
- </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement