• Resolved laserstore

    (@laserstore)


    Hi!
    The cloudflare cache is expiring too fast and I’m not finding the reason. My server is Litespeed and i’m using it in conjunction with WP-Rocket for optimizations only, but page caching is disabled and I’m using your plugin’s fallback cache. I also left unlimited global cache expiration in wp Rocket settings. This is the header:

    View post on imgur.com


    The red arrow shows the age of the cache in seconds and in less than 1 day it expires. The option “Overwrite the cache-control header for WordPress’s pages using web server rules” is enabled in your plugin. Could you tell me what is causing this early expiration? Are there any values ??I can change to increase this expiration time?

    Thanks a lot!

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

    (@isaumya)

    A few things:
    1. In the screenshot you have given above I can see that you have modified the s-maxage value from the default value. Unless you know what you are doing exactly don’t make a change and keep it to the default value for the best performance.
    2. Inside Cloudflare dashboard, go to Caching Tab > Configuration and ensure that “Browser Cache TTL” is set to “Respect Header”
    3. Inside Caching Tab > Tiered Cache > Enable Smart Tiered Cache
    4. Go to the page rule section and share a screenshot of the page rule section.

    Thread Starter laserstore

    (@laserstore)

    Hi @isaumya thanks for the quick support

    The default settings you suggested are the ones I’ve always tried to use, but within a few hours the cache expires. Changing s-maxage has only been changed for testing, but any value there does not interfere because expiration is occurring at different times than specified. It is a store with more than 600 url’s and this harms performance because it is a very short time to take advantage of the resource. In page rules, it is active only necessary as in the image. I’m deleting the panel.

    View post on imgur.com

    After the changes I made, the cache lasted approximately 12 hours, but it expired and there were some broken pages.
    I would like to know what age cache is counting in age, which is the image I uploaded earlier. This age is not compatible with either max-age or s-maxage.

    Thank you very much for your support!

    Plugin Contributor iSaumya

    (@isaumya)

    I have no idea what you are saying I have told you the steps that you need to take in the previous reply.

    The s-maxage tells Cloudflare how long you want that content to remain cached but that is just a suggestion. If that request does not have much traffic to it, CF will delete the cache fro it’s system. Enabling Smart Tiered Cache (as mentioned above) will help with that increasing cache HIT ratio.

    Read this article to understand how CF cache system works: https://acnam.com/untold-truths-of-cloudflare-cdn/#cloudflare-cache-creation-replication-storage

    Thread Starter laserstore

    (@laserstore)

    What I mean is that whatever value I set, the cloudflare cache expires in a few hours and then needs to be rebuilt. Even though the value in s-maxage is 1 year, it’s like clearing the entire cache every hour automatically. So I have to rebuild the entire cache again because the “cf-cache-status” header is in “expired” mode. I believe that some transient or command is forcing the cache to clear.
    I’ve tried everything but I can’t make the expiration stop.

    Plugin Contributor iSaumya

    (@isaumya)

    Have you turned on the smart tiered cache?
    Does your site has good amount of visitors or very few visitors?
    Inside the Caching tab (cf dashboard) > configuration > Browser Cache TTL is that set to Respect Header?

    Thread Starter laserstore

    (@laserstore)

    ———-Have you turned on the smart tiered cache?
    Yes
    ———-Does your site has good amount of visitors or very few visitors?
    70k month
    ———-Inside the Caching tab (cf dashboard) > configuration > Browser Cache TTL is that set to Respect Header?
    Yes (I’ve already tested it with other values)

    Plugin Contributor iSaumya

    (@isaumya)

    Enable the “Browser Cache Rule for Static FIles” option inside the plugin settings under cache tab at the very end.

    Plugin Contributor iSaumya

    (@isaumya)

    I am visiting your site for the first time and it is already HIT
    check: https://i.imgur.com/6CjWEAA.png

    So, the smart tiered cache is doing it’s magic and pages are getting served from CF CDN

    Thread Starter laserstore

    (@laserstore)

    Hey @isaumya Thanks for your help.
    The smart tiered cache helps a lot in anticipating the HIT but I still have the cache expiring. I activated the option “Browser Cache Rule for Static Files” and I will test it.
    I found that a WP Rocket CRON event (rocket_purge_time_event) that occurs every 1 hour was clearing the cloudflare cache because I had added the integration there and removed that integration to avoid that. I will return as soon as the period it expires is over.

    Thank you very much!!

    Plugin Contributor iSaumya

    (@isaumya)

    Awesome to know that you have found the problem and the issue is now resolved.

    Thread Starter laserstore

    (@laserstore)

    Hi @isaumya
    As I suspected, the problem was actually resolved. Thank you for your support!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Age of cache’ is closed to new replies.