Skip to content

Instantly share code, notes, and snippets.

@farinspace
Created July 17, 2018 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farinspace/e7628d56b39f43bd5eaeedbf56e95ccb to your computer and use it in GitHub Desktop.
Save farinspace/e7628d56b39f43bd5eaeedbf56e95ccb to your computer and use it in GitHub Desktop.
Prevent long caching in subdirectory for a WPEngine install
# Request is cached for at maximum of 10 minutes, then origin revalidation starts
# Clients that send "If-Modified-Since" headers will recieve 304 response unless the file actually changes on origin
# Use: `add_header Last-Modified ""` to remove Last-Modified server headers
location ~* ^/wp-content/themes/theme/subdir/ {
add_header Cache-Control "public, max-age=600, must-revalidate";
etag off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment