• Resolved kinansy

    (@kinansy)


    checking the cache hit. i find files with max_age”:604800
    while in the plugin Browser Cache-Control max-age it is 60

    Can i change it to respect the origin just like it is in Cloudflare ?

    why not set browser cache too high. as changing any static file will take a different name. am i correct on this ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    Those rules are for the first text/html type request. And not for the static files. If you want the plugin to add proper caching for the static file then please enable the option for adding browser cache rule for static files in the plugin settings under the cache tab.

    I will highly recommend you not to tinker with the default value for the text/html type requests unless you absolutely know what you are doing as it can have very bad effect on your site.

    First inside the cloudflare dashboard the Borwser TTL should always be set to Respect Header. Secondly the reason the max-age is set to 60 seconds is because you won’t want the user browsers to cache the HTML pages for too long as the HTML pages might change it’s content and users might not see the updated content.

    That is why we set the s-maxage value to 1 year by default which tells CF for how long you want your pages to be cached in CF CDN. So, if a page gets updated the CF cache will be purged and the browser will get the updated page from CF CDN. Also as the CF CDN is so close to your location you will have the lowest TTFB.

    Thread Starter kinansy

    (@kinansy)

    and the logged in users are also excluded from this rule “Cache-Control max-age it is 60” as well
    is that correct ?

    Plugin Contributor iSaumya

    (@isaumya)

    yes for loggedin user the cache-control is set to no-cache, no-store, max-age=0 for the first text/html type request. But static files will still be cached by Cloudflare.

    Thread Starter kinansy

    (@kinansy)

    @isaumya

    for loggedin user the cache-control is set to no-cache, no-store, max-age=0 for the first text/html type request

    So, the second page visit is served from cached?
    if yes, will it get purged if the user answered a quiz or posted a comment

    Plugin Contributor iSaumya

    (@isaumya)

    As I said, for loggedin users pages won’t be cached (except static files) and pages will be served from origin server. For non loggedin users pages will be cached so both the page and it’s associated static files will be served from CF CDN Cache.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘cf-nel”,”max_age”:604800}’ is closed to new replies.