• Hello,

    We’ve been struggling with caching/page scores for a while since installing this plugin, and get some weird behaviour.

    For example, in the plugin we’re getting: Page caching seems not working for both dynamic and static pages. despite the headers looking like it’s working correctly. At the same time, the site is very slow and returns E/F scores in gtmetrix.

    If we then ‘purge cache’ in the plugin settings and re-test the cache, we get the green tick and an A score in gtmetrix. But this only lasts for a while and it goes back to the poor performance (e.g. we purged cache last night, performance was great, but back to E/F scores this morning)

    It would be great if you could help us understand what’s causing this.

    Thanks,

    • This topic was modified 2 years, 10 months ago by fizzers.
    • This topic was modified 2 years, 10 months ago by fizzers.

    The page I need help with: [log in to see the link]

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

    (@isaumya)

    Hi,
    your issue is so related to this thread: https://wordpress.org/support/topic/incognito-mode-with-safari-or-opera-bypass-incognito-mode-with-chrome/

    While checking your page response header I see that on your pages a cookie (PHPSESSID) is being set which is totally useless. Screenshot: https://i.imgur.com/8ZjYlmE.png

    As I said on that thread, any time Cloudflare sees a custom cookie in the response header it does not cache that page thinking that your page content might be dependent on the cookie value.

    Looking at the response header, it also seems like you have some other server-level caching enabled. Here is what I will suggest you:

    1. Find what is adding that PHPSESSID cookie and remove that.
    2. If you have any other server-level page caching system or rather any other page caching system, disable that.

    Then purge the whole cache and test.

    Hope this helps.

    Thread Starter fizzers

    (@fizzers)

    Hello @isaumya,

    Thanks so much for getting back to me and identifying the culprit.

    After disabling plugins one by one, PHPSESSID is being set by the Code Snippets plugin. This plugin is utilised heavily by our site, what do you recommend we do here?

    In terms of other caching systems, we’re only using the SiteGround Optimizer plugin but all of the relevant settings should be disabled, and OMGF, for fonts performance.

    Thanks,

    Plugin Contributor iSaumya

    (@isaumya)

    PHPSESSID is being set by the Code Snippets plugin. This plugin is utilised heavily by our site, what do you recommend we do here?

    – Do not reply on plugins like code snippets not just for issues like these but also many security issues down the line. The best approach is to add those snippets directly into your theme’s function.php file.

    In terms of other caching systems, we’re only using the SiteGround Optimizer plugin but all of the relevant settings should be disabled, and OMGF, for fonts performance.

    – In your response header it seems other caching system is also involved so it’s best to disable any sorts of page caching either on server level or any other plugin trying to do page caching.

    Thread Starter fizzers

    (@fizzers)

    Thanks for the help @isaumya.

    Siteground Optimizer also handles our css + js + html minification, image compression/optimisation and database maintenance.

    Could you recommend a plugin/plugins that would replace this functionality while playing nicely with Super Page Cache?

    Plugin Contributor iSaumya

    (@isaumya)

    Well, you can do css, js and HTML modification from Cloudflare. For DB optimizations there are many plugins including Perfmatters. For image optimization you can use systems like imagekit.io, optimole etc. Imagekit has a great free plan too.

    Thread Starter fizzers

    (@fizzers)

    Hi @isaumya,

    The PHPSESSID cookie was being set by some code that allowed the random sort by option on our store to behave correctly. After disabling that, the cookie is gone.

    Siteground Optimizer plugin has also been disabled.

    Flushed the cache and tested, but unfortunately we’re still getting the following:

    Error on dynamic page (https://pips-seedbank.co.uk): Cache status: DYNAMIC - The resource was not cached by default and your current Cloudflare caching configuration doesn't instruct Cloudflare to cache the resource. Instead, the resource was requested from the origin web server.
    
    Error on static resource (https://pips-seedbank.co.uk/wp-content/plugins/wp-cloudflare-page-cache/assets/testcache.html): Unable to find the Cache-Control response header.
    • This reply was modified 2 years, 10 months ago by fizzers.
    • This reply was modified 2 years, 10 months ago by fizzers.
    Plugin Contributor iSaumya

    (@isaumya)

    Now you are seeing the issue because you have set the s-max-age and max-age both to 0. Try deactivating the page caching in the plugin then delete the plugin and reinstall and set up the plugin with the default values. Things should be fixed then.

    Screenshots:

    View post on imgur.com

    View post on imgur.com

    Thread Starter fizzers

    (@fizzers)

    Hi @isaumya,

    I reset from the beginning of setup without deleting and reinstalling the plugin and it appears to be working now (but still getting the error message in the plugin).

    Are you able to confirm if it now looks correct on your end?
    Also please are you able to confirm please if it’s safe to leave CF Railgun and RocketLoader enabled, should those be disabled, or does it make no difference?

    • This reply was modified 2 years, 10 months ago by fizzers.
    Plugin Contributor iSaumya

    (@isaumya)

    Now I am not seeing any cache-control header on your webpages.
    Please try deleting and a fresh install.

    Thread Starter fizzers

    (@fizzers)

    Done, @isaumya.

    Plugin Contributor iSaumya

    (@isaumya)

    Do you see proper cache control header now? I won’t be able to check till Monday.

    Thread Starter fizzers

    (@fizzers)

    Still missing from what I can see.

    Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    as I can see the plugin is perfectly working now:

    View post on imgur.com

    View post on imgur.com

    But I would suggest keeping the max-age value to default value i.e. 60 inetas of 600.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[NSFW] Weird caching behaviour’ is closed to new replies.