• Resolved laserstore

    (@laserstore)


    Hi guys!
    When I use your plugin together with WP-Rocket, it works excellently, but for a short time. After a few minutes the cache expires. The page cache option is already disabled as suggested and the functions “Overwrite the cache-control header for WordPress’s pages using web server rules” and “Add browser caching rules for static assets”.
    The fallback cache option is also active. What could I do to fix this? My site doesn’t work well with other performance plugins, so I’d like to use both together.
    Thank you so much!!

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

    (@isaumya)

    Can you share your website URL?

    Thread Starter laserstore

    (@laserstore)

    Hi @isaumya ! This is the header console image. just give an F5 and it reloads the cache, but shortly after it expires again.

    View post on imgur.com

    I’m using on a test domain idogyou.com.br

    Thank you!!

    Thread Starter laserstore

    (@laserstore)

    Hey @isaumya
    Now I did the same test on the official website and the same happens. The link is https://www.dogvibe.com.br
    Apparently this occurs after around 20 to 30 minutes
    Thanks a lot!

    • This reply was modified 3 years, 3 months ago by laserstore.
    Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    Can you check 2 things in your Cloudflare Dashboard?

    1. Go to the Page Rules section and there make sure there is only one page rule i.e. added by the plugin there. If you see any other page rules there that is modifying the cache behavious/options in anyway, just disable/delete them. You should only have the 1 page rule (i.e. cache everything).

    2. Check the Cache > Configuration section and make sure that Browser cache TTL is set to Respect Header: https://i.imgur.com/YiNlK4n.png

    Thread Starter laserstore

    (@laserstore)

    Hi @isaumya
    I have three rules, two being exclude caching the admin panel host and the access admin panel site and the other caching everything else. If I eliminate the other two I have problems with the panel. Should I change the order?

    View post on imgur.com

    • This reply was modified 3 years, 3 months ago by laserstore.
    Plugin Contributor iSaumya

    (@isaumya)

    None of those rule looks like added by this plugin. You don’t need any additional rule. Disable Cache in the plugin settings. Then go to the Page Rule section and delete all the page rules you have. Come back to the plugin settings and enable page cache again.

    You can keep the rule for cPanel but beside that you don’t need the second rule.

    also try disabling the first rule as well. have you also checked the browser cache ttl section?

    • This reply was modified 3 years, 3 months ago by iSaumya.
    • This reply was modified 3 years, 3 months ago by iSaumya.
    Thread Starter laserstore

    (@laserstore)

    @isaumya thank you for your efforts to help me!
    I disabled all the rules and left only the one to cache everything. The TTL is as you indicated to respect the existing headers. In this case, should I also enable the option “Add browser caching rules for static assets” in my plugin? And when clearing the cache should I always do it through your plugin or also through wp-rocket?

    Thread Starter laserstore

    (@laserstore)

    Apparently the cache is expiring after 3600 seconds. In which location do you believe this time would be configured?

    View post on imgur.com

    Thread Starter laserstore

    (@laserstore)

    Hi @isaumya !
    After some time searching, I found the reason why the cache expires after about an hour. WP-Rocket creates a standard event called rocket_purge_time_event that checks and clears the cache even when Lifespan has larger time values, like 10 hours for example.
    Here is information about it https://docs.wp-rocket.me/article/1383-cache-lifespan

    I still don’t understand why it clears the cache, as I understood that this event would be associated with lifespan, but what I did was change the runtime in cron to a longer period and solved the Cloudflare cache expiration issue.

    View post on imgur.com

    Hope this helps someone in the future.

    Hi @laserstore,

    Thanks for leaving this here for others.

    Are you able to advise me on how to change this runtime in cron and what period of time did you choose? Did it affect your website on any other way?

    Thread Starter laserstore

    (@laserstore)

    Hi @piotrk87 !
    Until a few days ago I couldn’t solve it, but I found many things in tests that were essential to solve the problem. An immutable value is Max Age alt-svc. It will always be 86400 seconds which is determined by the cloudflare itself. So your cache will expire when it reaches this value anyway. But there is a small incompatibility with WP Rocket that ends up expiring even before that time, in my case it was expiring every hour. I found an event in cron called rocket_purge_cache_event that fires every hour and it was expiring Cloudflare’s cache and I didn’t understand why this was happening.
    So I managed to change this cron renaming and disabling, but the problem occurs because of the integration of cloudflare in the plugin wp rocket in add-ons. Then he deleted the entire cache. Just don’t activate the cloudflare add-on in wp rocket, it won’t have to delete the cache even with the cron enabled.
    For security I decided to disable the event but I haven’t tested it with it active after removing the inbtegra??op, but I believe it works. Now, it′s all ok!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Cache Expired with WP Rocket’ is closed to new replies.