• Resolved vtekfi

    (@vtekfi)


    Hello,

    I recently enabled your plugin and am having some hard time getting it working.

    When I do “Test Cache”, I get this:

    Page caching seems not working for both dynamic and static pages.
    
    Error on dynamic page (https://www.jsgroup.fi): 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.jsgroup.fi/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.
    
    Please check if the page caching is working by yourself by surfing the website in incognito mode 'cause sometimes Cloudflare bypass the cache for cURL requests. Reload a page two or three times. If you see the response header cf-cache-status: HIT, the page caching is working well.
    

    I am not sure how I can check the cf-cache-status response header? The webserver is using Apache.

    Any tips would be most welcome 😉

    Thank you,

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    Hi @vtekfi ,
    I see 2 cache-control response headers from your website:

    cache-control: s-max-age=604800, s-maxage=604800, max-age=60
    cache-control: private, must-revalidate

    The first is right (it is the one sent by this plugin), the second does not allow Cloudflare to add your page in cache.

    Are you using other performance plugins? Or are you using htaccess rules that generate that second header, for example rules concerning html pages?

    Thread Starter vtekfi

    (@vtekfi)

    Thanks for the swift reply!

    No, I am not using any other performance plugins. My htaccess is as follows:

    # 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
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    Options -Indexes
    
    # 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_expires.c>
    ExpiresActive on
    ExpiresByType application/xml "access plus 0 seconds"
    </IfModule>
    <FilesMatch "robots\.txt">
    <IfModule mod_headers.c>
    Header set Cache-Control "max-age=0, public"
    </IfModule>
    </FilesMatch>
    # END WP Cloudflare Super Page Cache
    
    

    I am using Wordfence plugin, could this interfere with your plugin?

    Thread Starter vtekfi

    (@vtekfi)

    I’ve tried hard to find a solution for this. But for some reason, I cant get rid of cache-control: private, must-revalidate.

    Do you have any other tips what I could be looking for? Server is running cPanel and Apache with PHP 7.4. Also, the site has been built with Divi Builder.

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @vtekfi,
    Currently when seeing the response header of your website I see that this plugin is not enabled in your website. Also, I still see cache-control: private, must-revalidate in the response header. Have you checked your Must Use plugins section to ensure there is nothing there that might be overwriting the cache-control header? Otherwise, have you tried to talk with your host to figure out what’s added that cache-control header?

    Thread Starter vtekfi

    (@vtekfi)

    Thanks for the reply. I disabled the plugin few days back as I had no success of getting it working properly. And I am still not sure where that cache-control: private, must-revalidate comes from. Believe me I have tried figuring it out. 😉

    I have checked the plugins, there really isn’t that many. Updraft, Wordfence, Shortpixel, Yoast. Tried disabling those as well. I run my own “host”, its privately run cpanel system. I have another site on the same server, running this plugin just fine.

    Can there be something wrong with my Cloudflare settings? Or should the plugin take care of those when the API info is entered?

    Thanks again,

    EDIT: I have enabled the WP Cloudflare Super Page Cache plugin again.

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

    (@isaumya)

    Hi,
    As you host your own site I want you to do the following:

    • Check if your site has any must use plugins in mu-plugins folder and if so delete them.
    • If you still see the same cache-control header, in your server setup a fresh WordPress site (in s subfolder or subdomain) with the default theme and nothing installed there. Just a sample WP install and sens me that link.
    Thread Starter vtekfi

    (@vtekfi)

    Hi,

    mu-plugins/ folder was empty.

    Installed fresh WP install at https://dev1.jsgroup.fi

    The fresh site also gets cache-control: private, must-revalidate

    So I assume there must be something going on with the server itself.. Ack, guess I need to do more investigating. If you have any tips, please do let me know. :/

    Plugin Contributor iSaumya

    (@isaumya)

    Hi @vtekfi,
    You are absolutely right. That’s why I asked you to do the fresh dummy install so that we got nothing else to blame. Yes, it is 100% something with your server-level configuration. Look at your apache configuration files. Now you know where to look.
    I’m certain you will find it. 🙂

    • This reply was modified 3 years, 5 months ago by iSaumya.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Page caching seems not working for both dynamic and static pages.’ is closed to new replies.