• tas

    (@tasiek)


    Hi,

    I can see cf-cache-status: HIT on many assets, but never on first html request.

    Its always:

    cache-control: no-store, no-cache, must-revalidate, max-age=0
    cf-cache-status: BYPASS

    Also, in log I can see that pages that are not supposed to be cached, are being preloaded.

    [2022-03-13 19:42:26] [preloader::task] Preloading URL https://vfxtricks.com/my-account/
    [2022-03-13 19:42:30] [preloader::task] Preloading URL https://vfxtricks.com/checkout/

    Here is my .htaccess

    # BEGIN LSCACHE
    # END LSCACHE
    # BEGIN NON_LSCACHE
    # END NON_LSCACHE
    
    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    Header always set Content-Security-Policy "upgrade-insecure-requests;
    </IfModule>
    
    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php74” package as the default “PHP” programming language.
    <IfModule mime_module>
      AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit
    
    # BEGIN WP Cloudflare Super Page Cache
    # The directives (lines) between "BEGIN WP Cloudflare Super Page Cache" and "END WP Cloudflare Super Page Cache" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_headers.c>
    Header unset Set-Cookie "expr=resp('x-wp-cf-super-cache-active') == '1'"
    Header always unset Set-Cookie "expr=resp('x-wp-cf-super-cache-active') == '1'"
    </IfModule>
    <IfModule mod_expires.c>
    ExpiresActive on
    ExpiresByType application/xml "access plus 0 seconds"
    ExpiresByType text/xsl "access plus 0 seconds"
    </IfModule>
    <FilesMatch "\.(xml|xsl)$">
    <IfModule mod_headers.c>
    Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
    </IfModule>
    </FilesMatch>
    <FilesMatch "robots\.txt">
    <IfModule mod_headers.c>
    Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
    </IfModule>
    </FilesMatch>
    <IfModule mod_rewrite.c>
    RewriteCond %{REQUEST_URI} ^(.*)?/wp-content/wp-cloudflare-super-page-cache/vfxtricks.com/debug.log(.*)$
    RewriteRule ^(.*)$ - [F]
    </IfModule>
    <FilesMatch "wp-cron.php">
    <IfModule mod_headers.c>
    Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
    </IfModule>
    </FilesMatch>
    # END WP Cloudflare Super Page Cache

    View post on imgur.com

    View post on imgur.com

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

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

    (@isaumya)

    Hi @tasiek,
    From what I can see on your website is that, the plugin is not able to work properly on your website. Something is conflicting with the plugin on your website. It might be some other page caching plugin you have or some other page caching solution you have at the server level.

    Please note that you cannot use more than one page caching solution on one site. So, it is highly recommended that you disable all other page caching solution (both at the plugin level and at the server level) to ensure the plugin can do it’s job properly.

    While check the response headers of your webpages I can see that there are no response headers that are addeded by the plugin which implies that the plugin is not able to handle your response headers and something else is overwriting the plugin’s ability.

    When the plugin is working you are supposed to see a few x-wp-cf-super-cache custom headers in the response header (example: https://i.imgur.com/9Tr8tkJ.jpeg) which is missing in your case.

    Also when I checked the response header of your home page I can see that the cache-control is set to no-transform, no-cache, no-store, must-revalidate which is not done by this plugin or any of it’s associated code. As if the plugin would have been doing it then there would have been an extra maxage=0 which is not present here.
    Screenshot: https://i.imgur.com/iPZ0vmy.jpeg\

    Now when I checked the “Toolbox” page there are no cache-control header to begin with.
    Screenshot: https://i.imgur.com/eRZ0Q1V.jpeg

    Same situation on your Terms page.

    So, now you need to figure out what caching solution is doing these things. If you have server level page caching, contact your host to disable that.

    Moreover, first delete this plugin, then delete all other page caching plugins you have. And make sure all of it’s traces have been properly deleted. Make sure there is no advanced-cache.php file inside the /wp-content/ folder. There is no mu-plugin related to page caching or modifying response header.

    Then you feash install this plugin and set it up.

    Thread Starter tas

    (@tasiek)

    Hi,

    Thank you for many clues.

    1. I dont have any caching/performance plugin installed.
    2. I switched back to Google DNS from Cloudflare
    3. I reinstalled Super Page Cache plugin

    Things look different, but still not good.

    1. Now I do have cache-control: no-store, no-cache, must-revalidate, max-age=0, which means this plugin is writing it. Why no cache?
    2. I dont see any cf headers in response.
    3. css/js assets are not cached by cf anymore, no headers.

    Is it required to use CF DNS ? Previously I followed youtube tutorial, but I realized it was not necessary to mess with dns.

    This part of setting is very confusing to me, it looks like /* means not to cache any page. I cannot edit it out, it always comes back.

    View post on imgur.com

    Thanks

    Thread Starter tas

    (@tasiek)

    I was so wrong about not using CF DNS, its part of adding website process in CF Dashboard.
    Im back to using CF DNS.

    The main question is, how to remove /* from “Prevent the following URIs to be cached” settting?

    I think this is causing all my pages from being cached.

    View post on imgur.com

    Thread Starter tas

    (@tasiek)

    ok, I finally got it working.
    I use woocommerce, in Third Part tab, WC section, if Cart is cheked, it will append /* to the blocked URLs.

    Once I uncheck it its all good.

    View post on imgur.com

    It that a bug or a feature?
    I need to do much more testing now with pages being cached.

    Thanks for help

    • This reply was modified 3 years ago by tas.
    Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    First of all, I can now confirm that Cloudflare caching is properly working on your site: https://i.imgur.com/RFjEUSo.jpeg
    Please make sure that:
    1. inside your Cloudflare Dashboard, under the page rule section you only have 1 page rule that is added by this plugin (the cache everything page rule). Beside that there are no other page rule that might be modifying the cache behaviour.
    2. Inside the CF dashboard > Caching tab > Settings – Bowser Cache TTL is set to “Respect Header”
    3. Inside CF Dashboard > Caching > Enable Tiered Cache
    4. Make sure there are no other page rule or worker modifying the cache behaviour of this site as it will all be handelled by the plugin itself.
    5. Make sure you enable the option inside the plugin settings under the cache tab to add the browser cache rules: https://i.imgur.com/Fn67zDl.jpeg

    The main question is, how to remove /* from “Prevent the following URIs to be cached” settting?

    – Now coming to the second question. That /* is what causing all the issue bypassing everything. That /* is not added by the plugin automatically. No matter what settis you enable or disable. I also tested again to double check this. There is no way the plugin is automatically adding the /* as I have tested across many sites. It might be possible it is mistakenly been typed by you or someone while setting up the plugin.

    • This reply was modified 3 years ago by iSaumya.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘cannot get caching working’ is closed to new replies.