WordPress Installation



we provide WordPress hosting and as part of our package we shall be including Fastly. At present we are trying to understand Fastly and how best to configure it for these type of instances. We control our backend origin servers that are running Apache 2.4, PHP 5.6 and Mod_PageSpeed. Would welcome feedback on cache settings are what we are using at present

   <FilesMatch "\.(html|htm)$">
      Header unset Etag
      Header set Cache-control "max-age=0, no-cache, no-store"

   <FilesMatch "\.(jpg|jpeg|gif|png|js|css)$">
      Header unset Etag
      Header set Cache-control "public, max-age=600"

do not really appear to be cutting the mustard. Aswell, we would also like to understand how we can completely bypass Fastly for the WordPress /wp-admin area ? That would be better going straight through to origin instead of the cache.

Grateful for any and all help.


Hey @INNOVOT what do you mean by “not cutting the mustard”? How have you been testing these rules so far?

To make sure that we never cache content, adding a Cache-Control: private header to the content will make sure that we never cache, and always go right to your backend. Something like:

 <FilesMatch "/wp-admin">
      Header unset Etag
      Header set Cache-control "private no-store no-cache"

… may work for you. You only need private for Fastly, but the no-store no-cache will help to be extra safe.


Also, following doc might be helpful re: cache control headers


Thank you shash, that has been very helpful indeed.


in my .htaccess I’ve insert code above but backend page is cached and and I keep getting errors.
Could you help me?


@microtag since it sounds like this may involve some detailed debugging of your specific application, could you email support@fastly.com about this? I’ll see the ticket as it comes in.