• Resolved Anonymous User 18794746

    (@anonymized-18794746)


    When we activate this plug-in, it changes some settings in Cloudflare Dashboard via the API. In these settings, it sets a page rule to cache everything, and browser cache TTL to respect existing headers. (Correct me if I missed something)

    Now, the plugin sets s-maxage to 1 year, but I found that it is actually not working. I had opened some pages on my website yesterday, but on today morning, it showed cache status miss on the same pages. If pages are being cached for a year, it should not show miss status. So how does it actually work ? Does the plugin set any other things ?

    I read that in order to use s-maxage, we need origin cache control turned on. It is not turned on by the plugin. Although Cloudflare says that they turn it on by default for all except Enterprise accounts, I cannot understand why caches expire after a day. I have not performed any changes on my site or purged cache.

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

    (@isaumya)

    When we activate this plug-in, it changes some settings in Cloudflare Dashboard via the API. In these settings, it sets a page rule to cache everything, and browser cache TTL to respect existing headers. (Correct me if I missed something)

    – You are absolutely right

    Now, the plugin sets s-maxage to 1 year, but I found that it is actually not working. I had opened some pages on my website yesterday, but on today morning, it showed cache status miss on the same pages. If pages are being cached for a year, it should not show miss status. So how does it actually work ? Does the plugin set any other things ?

    – The s-maxage header tells Cloudflare servers for how long you intend that page to be cached in CF server. But that just tells your intent. It does not mean that your pages will remain cached for 1 year even if it does not have any traffic. I will highly recommend you to take a look at this art of this article to better understand how CF cache works: https://acnam.com/untold-truths-of-cloudflare-cdn/#cloudflare-cache-creation-replication-storage
    This article will clarify all your doubts.

    Thread Starter Anonymous User 18794746

    (@anonymized-18794746)

    Hi @isaumya..! First of all thank you for this article. You have done excellent job with detailed observations..!

    It cleared all my doubts. As you know, Cloudflare’s documentation is not well organized and sometimes, it becomes very difficult to find things. Also, much of it is not well updated according to their latest policies. There may be some ‘Trade secrets’ as well. That’s why I asked here how things work.

    You cleared all my doubts. Thanks for support..!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How does Cache-Control actually work ?’ is closed to new replies.