Issue Invalidating Google Cloud CDN Cache with Wordpress

328 Views Asked by At

After Few days of Research and Reading Google cloud Documentation while understanding Google Cloud CDN Caching . Finally I was able to Setup Google Cloud CDN with Wordpress. Properly setting cache header and setting Vary header as Google CDN Requires and also implementing the Etags and Last modified headers to the requests. The Wordpress Website is Caching Fine but I left squeezing my head when i found, Anything I update in the backend Wordpress is not changing in real time to the Google CDN Cache. So,The Problem is:-


Problem:- If I update post on wordpress it still shows the cached version until expires/ Cache Control: max-age time Reaches. This makes No use of Last Modified and Etags. Why it doesn't respect Backend Status code 304 and get a fresh copy when page changed.

What I want:- Google CDN To check Last Modified and ETags of request with backend and if changed get a fresh copy else show cached Version.


Note:- In byte Range request I found, that it uses byte range before checking for Etags and Last Modified of request. If is it true? If Yes, What changes i have to make in order it to work?

Please Help me in Problem, So if i make changes it fetches a new copy. Please Check the headers and let me know if there is any problem website is given Below. Thanks

Website

1

There are 1 best solutions below

1
On

Google Cloud CDN sends a validation request only once max-age elapses. That's the point of max-age. If you want Cloud CDN to send a validation request on each access, set max-age=0.