0

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
    Welcome to Stack Overflow. This site is for programming-specific questions. Questions about WordPress administration, server configuration, etc. are off topic and are more suited to the [dedicated WordPress Development Stack Exchange site](https://wordpress.stackexchange.com).  However please review their help section first before posting to make sure your question meets their guidelines. – FluffyKitten Oct 03 '20 at 19:49
  • I understand @FluffyKitten , But this question is more inclined towards the Google Cloud CDN than being specific for Wordpress. So, I felt this community is better choice for this. – Chaklesh Yadav Oct 05 '20 at 07:27

1 Answers1

0

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.

elving
  • 1,441
  • 8
  • 7
  • It is ok to honor the max age, but there is something else like Last-Modified and Byte Range in the Documentation link above which I unable to Understand and Implement Clearly. Does Google CDN Checks for Last Modified and Etags? If Yes, Can you check my headers. Is it implemented properly, as google cdn is not considering my last modified headers. – Chaklesh Yadav Oct 05 '20 at 07:33