Best Max Age on The Server Side!
-
First of all @isaumya thank you.
Before i did not know much about Cloudflare Cache System.
I read alot article and with your replies i learned much more.I have a question.
the cache-control header setted up by WP Cloudflare Super Page Cache has 2 main values: max-age: this is the time to live in seconds for browser cache, and must be greater than zero (at least 1) s-max-age: this is the time to live in seconds for the Cloudflare’s cache
In the default plugin settings
max-age = 60 ( Browser cache 1 minutes am i right?)
s-max-age = 1 year ( Cloudflare cache )For the browser cache side;
Browser Cache TTL The Browser Cache TTL sets the expiration for resources cached in a visitor’s browser. By default, Cloudflare honors the cache expiration set in your Expires and Cache-Control headers but overrides those headers if: The value of the Cache-Control header from the origin web server is less than the Browser Cache TTL Cloudflare setting. The origin web server does not send a Cache-Control or an Expires header. Unless specifically set in a page rule, Cloudflare does not override or insert Cache-Control headers if you set Browser Cache TTL to Respect Existing Headers.
I am not sure i undertood above information right!
Respect Existing Headers mean that Cloudflare uses Origin Server’s headers!
But despite we choose Respect Existing Headers; if we set a page rule like cache everything than Cloudflare settings, then Cloudflare can instert their headers in two situations!a) Cloudflare Browser Cache TTL seconds > Origin Server Browser Cache TTL seconds
b) The origin web server does not send a Cache-Control or an Expires header.Even we chose Respect Existing Headers, if there is no rule in rule section Cloudflare never insert cache-control and only use Origin Server’s headers!
Am a understand right?
In this stuation if i use your plugin,
max-age = 60 ( Browser cache 1 minutes am i right?)
s-max-age = 1 year ( Cloudflare cache )I have a nginx fastcgi cache server and there is a code in it:
location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ { expires max; log_not_found off; }
So Cloudflare use my server’s header because there is a cache everything rule and 1y>60 senconds.
What is the best expire dor nginx cache in this situation.
If wp cloudflare cache plugin use 60 seconds i should use 30 seconds or no need to use this above code in nginxWhat you think.
Please correct me if there are incorrect informationsThank you thank you
- The topic ‘Best Max Age on The Server Side!’ is closed to new replies.