• Resolved stvinmotion

    (@stvinmotion)


    Hi and thanks for the awesome plugin!

    I had it working but after disabling it to find a culprit (“disable Page cache”) and re-enabling it again I can’t seem to make it work.
    I’m using WP-Rocket but caching is disabled there and on the “Third party” tab.

    Thanks

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

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

    (@isaumya)

    Hi It seems there are bunch of things going on in your site. Like some other worker trying cahe your site + railgun. If you have any sorts of caching enabled in the hosting level please disable that so that this plugin just directly access your cloudflare account and nothing else.
    Screenshot: https://i.imgur.com/AfENGyS.jpeg

    Also inside the CF dashboard check if the page rule has been added by the plugin.

    Thread Starter stvinmotion

    (@stvinmotion)

    Thank you.

    I disabled any Siteground hosting caching and the CF-railgun & SG-optimizer are not showing anymore.

    The only page rule I have on CF shows
    http://www.stvinmotion.com/*
    Cache Level: Cache Everything

    Still no luck
    Thanks

    Thread Starter stvinmotion

    (@stvinmotion)

    There’s still a CF tab on Siteground’s sitetools showing this https://imgur.com/z8uUXM8

    Plugin Contributor iSaumya

    (@isaumya)

    You need to turn off Cloudflare management from siteground portal and directly Cloudflare with this plugin. No intermedeary. Just disconnect cloudflare from your siteground hosting completely and use your cloudflare details inside this plugin only.

    Currently you are not even using cloudflare. Your name server is pointing to siteground. You need to create a cloudflare account, point your name server to cloudflare and use that cloudflare account with this plugin.

    View post on imgur.com

    Thread Starter stvinmotion

    (@stvinmotion)

    Thank you @isaumya

    Success! I pointed my nameserves to CF and disabled any Siteground integration. It seems to be working now, CF-Cache-status: HIT on 2nd refresh.

    I had to use Strip response cookies

    Would really appreciate if you could verify that things are looking well, or in case you have further vital checkpoints as “point the nameservers to CF”. but for the time being, I am happy camper! ))

    Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    yes as far as I can see the Cloudflare cache is now working properly on your site:

    View post on imgur.com

    But I am still seeing x-proxy-cache: HIT which means some server level page caching is still active. Make sure it is disabled. https://i.imgur.com/6uelgGu.jpeg

    Moreover I generally don’t suggest using the stripe response cookies options, rather it is best to check which plugins are adding those custom cookies and try not using those plugins. As you are using a plugin which is constantly adding custom cookies to each page request and then you stripe the response cookies, it might not work properly.

    Finally I will also recommend you to enable the option for adding caching rule for the static files inside the plugin settings under the cache tab. https://i.imgur.com/YVsW9nh.jpeg

    Thread Starter stvinmotion

    (@stvinmotion)

    Thanks, I spoke to Siteground and the only way I could completely deactivate the server level page caching is through adding to the following code at the end of my .htaccess:

    <IfModule mod_headers.c>
    Header set Cache-Control “private”
    </IfModule>

    I get:
    x-proxy-cache: MISS
    x-proxy-cache-info: 0 NC:000000 UP:SKIP_CACHE_PRIVATE

    I deactivated all the plugins but cache still didn’t work without Strip response.
    I reactivated the plugins but get an error

    Page caching seems not working for both dynamic and static pages.
    
    Error on dynamic page (https://www.stvinmotion.com): Invalid Cache-Control response header. If you are using Litespeed Server, please disable the option Overwrite the cache-control header for WordPress's pages using web server rules, purge the cache and retry.
    
    Error on static resource (https://www.stvinmotion.com/wp-content/plugins/wp-cloudflare-page-cache/assets/testcache.html): Cache status: BYPASS - Cloudflare has been instructed to not cache this asset. It has been served directly from the origin.

    Tried to delete and reinstall, too.

    Plugin Contributor iSaumya

    (@isaumya)

    `the only way I could completely deactivate the server level page caching is through adding to the following code at the end of my .htaccess:

    <IfModule mod_headers.c>
    Header set Cache-Control “private”
    </IfModule>`

    – This is total BS. When you will add that rule the Cloudflare cache will also immediately stop working as you are setting the cache-control as private.
    So, now you have 2 choices, either you can keep the server level cache enabled and just deal with it and do not add the htaccess rule you have mentioned above or shit to a much better managed hosting company like BigScoots for example.

    Thread Starter stvinmotion

    (@stvinmotion)

    OK thanks for letting me know,
    I kept insisting with Siteground and the senior tech team supposedly disabled the dynamic caching on server level.

    `I reviewed your request and as pert it disabled the dynamic caching for the stvinmotion.com site on server level. Now the site will not use the dynamic caching:

    HTTP/2 200
    date: Mon, 21 Mar 2022 14:50:14 GMT
    content-type: text/html; charset=UTF-8
    vary: Accept-Encoding
    vary: Accept-Encoding
    x-ua-compatible: IE=edge
    link: <https://www.stvinmotion.com/wp-json/&gt;; rel=”https://api.w.org/&#8221;, <https://www.stvinmotion.com/wp-json/wp/v2/pages/372&gt;; rel=”alternate”; type=”application/json”, <https://www.stvinmotion.com/&gt;; rel=shortlink
    cache-control: s-maxage=31536000, max-age=60
    cache-control: max-age=0
    x-wp-cf-super-cache: cache
    x-wp-cf-super-cache-active: 1
    x-wp-cf-super-cache-cache-control: s-maxage=31536000, max-age=60
    x-wp-cf-super-cache-cookies-bypass: swfpc-feature-not-enabled
    set-cookie: bp_user-role=guest; expires=Wed, 28-Nov-2035 14:50:14 GMT; Max-Age=432000000; path=
    content-security-policy: upgrade-insecure-requests
    expires: Mon, 21 Mar 2022 14:50:13 GMT
    x-httpd: 1
    host-header: 6b7412fb82ca5edfd0917e3957f05d89
    [b]x-proxy-cache: MISS
    [/b]x-proxy-cache-info: d NC:000000 UP:SKIP_CACHE_MAX_AGE_ZERO
    cf-cache-status: BYPASS
    set-cookie: bp_user-registered=0; expires=Wed, 28-Nov-2035 14:50:14 GMT; Max-Age=432000000; path=
    expect-ct: max-age=604800, report-uri=”https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct&#8221;
    report-to: {“endpoints”:[{“url”:”https:\/\/a.nel.cloudflare.com\/report\/v3?s=wRls55jj2e5gfmB6%2BDW%2BXp4ILgYe85xidCPVFYAJun1dKKluCFz2IuixLPRlb%2B6L%2Ffl8Gq5y09clxv40fmIf5ThxVvdBdKMKsZhPtdrx7HcdATi2k48ayMauKKNsLL7y13Tfrpax”}],”group”:”cf-nel”,”max_age”:604800}
    nel: {“success_fraction”:0,”report_to”:”cf-nel”,”max_age”:604800}
    server: cloudflare
    cf-ray: 6ef77fa9796178a9-VIE
    alt-svc: h3=”:443″; ma=86400, h3-29=”:443″; ma=86400`

    Donno it that’s sufficient or done in the right way?

    Now I got it working when WP rocket is disabled.
    When enabling WP rocket (and caching is disabled on the Third party tab)
    I get the error

    Page caching is working for static page but seems not working for dynamic pages.

    Error on dynamic page (https://www.stvinmotion.com): Invalid Cache-Control response header. If you are using Litespeed Server, please disable the option Overwrite the cache-control header for WordPress’s pages using web server rules, purge the cache and retry.

    Plugin Contributor iSaumya

    (@isaumya)

    The reason you are having the issue with the wp rocket is because it is constantly generating the advanced-cache.php file to take over the file generated by the plugin.

    Try downloading this plugin from here:
    https://docs.wp-rocket.me/article/61-disable-page-caching

    Then insid the plugin’s code add these two following lines:

    add_filter( 'rocket_generate_advanced_cache_file', '__return_false' );
    add_filter( 'rocket_disable_htaccess', '__return_false' );

    Then add that file as the mu-plugin.

    Finally disable this plugin and reset it up again. Hopefully this time wp rocket won’t add their caching files.

    Thread Starter stvinmotion

    (@stvinmotion)

    Did that and now when Super Page Cache is disabled and Rocket enabled there’s nothing in the advanced-cache php file.
    When I enable Super Page Cache and disable Rocket I get the caching working.
    When enabling Rocket again I get the same error.

    Plugin Contributor iSaumya

    (@isaumya)

    Cause you are doing it wrong. Begin with both plugin disabled. You need to make sure that the mu plugin is there for the wp rocket disable cache. Once the mu-plugin is there and active then enable wp rocket plugin and check if it is creating the advanced-cache.php file. If not, keep wp rocket enabled and then enable this plugin and set things up as you want and begin using cloudflare caching.

    Thread Starter stvinmotion

    (@stvinmotion)

    Both Disabled.
    I enabled WP Rocket – verified that there’s no Advanced-cache.php file created.
    I enabled Super Page Cache and still getting the error:

    Page caching is working for static page but seems not working for dynamic pages.

    Error on dynamic page (https://www.stvinmotion.com): Invalid Cache-Control response header. If you are using Litespeed Server, please disable the option Overwrite the cache-control header for WordPress’s pages using web server rules, purge the cache and retry.

    Plugin Contributor iSaumya

    (@isaumya)

    Can you now confirm that if there is any advanced-cache.php file it is not generated by WP Rocket?

    This is happening because there is still cache-control: max-age=0 in the response header. Check what is adding that. If you have added the mu-plugin of wp rocket and edited the mu-plugin code to add the 2 lines mentioned above then wp rocket si not supposed to generated the advanced-cache.php file. As generally cache-control: max-age=0 is added by wp rocket.

    • This reply was modified 4 years ago by iSaumya.
    Thread Starter stvinmotion

    (@stvinmotion)

    Caching works now ))

    I approached WP Rocket’s support:

    “we set the cache-control max-age=0 value for the nHTML file through the set of ModExpires rules we add in the htaccess file.
    See: Reference: .htaccess Rules

    Please try disabling the set of rules we add in the htaccess file for the ModExpires by installing this helper plugin:
    Remove expires (mod_expires) rules from .htaccess file

    Reference: Remove expires (mod_expires) rules from .htaccess file

    I turned this plugin into mu-plugin and caching works now.

    I activated Add browser caching rules for static assets, Auto prefetch URLs in viewport, Auto prefetch URLs on mouse hover. Would love to get any farther tips/todo from you.

    I still need to find what is causing response cookies.

    I’m considering testing if the first mu-plugin I created: wp-rocket-no-cache is still necessary and if not removing it.

    Thanks for the awesome support and suggestions!

Viewing 15 replies - 1 through 15 (of 22 total)

The topic ‘Cache status: DYNAMIC’ is closed to new replies.