Page caching seems not working for both dynamic and static pages.
-
Page caching seems not working for both dynamic and static pages.
Error on dynamic page (https://atelierb.ae): Seem that your website is not behind Cloudflare. If you have recently enabled the cache or it is your first test, wait about 30 seconds and try again because the changes take a few seconds for Cloudflare to propagate them on the web. If the error persists, request support for a detailed check.
Installed, setuped the CDN , butt the test is failing. Help please
[Moderator note: Please, No bumping].
- This topic was modified 3 years, 3 months ago by Steven Stern (sterndata).
The page I need help with: [log in to see the link]
-
Hi mate,
looking at the response header of your webpage it doesn’t seem like the plugin is installed in your site. Can you please confirm?
Screenshot: https://i.imgur.com/QFrz9yn.pngIf the plugin was installed then there are supposed to be a few extra response headers there added by the plugin.
Hi Saumya,
Yes it’s installed, active and even the page cache is enabled.
This is error I’m getting
https://imgur.com/undefinedThese are the active plugins
-Advanced Product Fields for WooCommerce
-Classic Editor
-Custom Fonts
-Select Duplicate Page
-Duplicate Page
-Elementor
-Elementor Google Map Extended
-Envato Market
-LoftLoader
-MC4WP: Mailchimp for WordPress
-One Click Demo Import
-Password Protected
-Site Kit by Google
-Slider Revolution
-Smash Balloon Instagram Feed
-WooCommerce
-WP Clone
-WP Cloudflare Super Page CacheWould appreciate your help in this matter.
RegardsHi,
looking at your list of plugin I do not see any other caching plugin involved. Can you check with your host if they have some sort of page cache enabled at the server level which might be removing all the custom response headers, setting the cache-control to max-age=0 and not letting the plugin to manipulate the cache control as it needed.As far as I can see I think this is happening with your hosting issue. I think your hosting company has some sort or page caching enabled at the server level. can you please check with them and confirm that? If they have some sort of page caching enabled at the server level, that needs to be disabled on your site.
Ok sure, let me talk to them.
What exactly should i ask them?
as I said ask them if they have any server-level page caching enabled
they said they disabled it, yet the same error. can u check plz
Hi,
sorry for the delayed reply due to the weekend, from what I can see is you have installed the default Cloudflare plugin on your site along with enabling APO: https://i.imgur.com/ZgGGJjZ.pngCan you please confirm it? I am still not seeing the response headers that are supposed to be added by this plugin.
If you have installed the official cloudflare plugin, please make sure you disable and remove that along with disabling APO inside your Cloudflare dashboard.
You cannot use this plugin as well as the official Cloudflare plugin. You need to choose between one.
i was checking other plugins if the issue presists,
its deactivated now, only your plugin is activated
please helpHi,
I think you have tinkered around the plugin settings and made some mistakes along the way. Try deactivating and uninstalling this plugin and install it as fresh. Then provide your CF API details and enable page cache. After that let me know.APO is off , as it’s a free plan
Deactivated, Uninstalled, Installed Again, Activated again with the API, YET the problem remains lol
Hi,
alright now as I can see that the plugin has been installed properly. So, there is no issue on plugin’s end.The reason you are facing this problem is because for your first request i.e. one with content type
text/html
your cache-control header value is forcibly set tono-store, no-cache, must-revalidate
. Screenshot: https://i.imgur.com/6cAiym9.pngWhich is basically telling Cloudflare to bypass cache on that page. Now look at your list of plugins and check if you have any other caching related plugin installed which might be adding this cache control header.
If not, check your must-use plugins section and if there is anything that might be doing it.
If not then this cache control rule might be getting added by your host. In tact case you need to contact your host and ask them to remove this cache control header that they are adding so that the plugin can add it’s own cache control header.
If you also have a
.htaccess
file in your hosting environment, check that as well, maybe there are some rules there that might be adding it.To summarize, now the plugin is installed properly but something is modifying and overwriting the cache control heqader value of your response before the plugin can do it’s work. So, you need to find out what is adding that cache-control rule and remove that.
Hi
In the MU-Plugins folder, the only file is
endurance-page-cache.php.bakshould i delete it?
yah you can delete it. But that is not adding that cache control header as that file is basically a dormant file as someone changed the file extension from
.php
to.php.bak
so that the file doesn’t get executed. You need to find what is adding that cache control header. Don’t forget to look inside your.htacess
file as well if you have that.soo i saw the htaccess and theres alot of cache control stuff going on there
what and which one to remove?********
# BEGIN WP Rocket v3.6.0.1 # Use UTF-8 encoding for anything served text/plain or text/html AddDefaultCharset UTF-8 # Force UTF-8 for a number of file formats <IfModule mod_mime.c> AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml </IfModule> # FileETag None is not enough for every server. <IfModule mod_headers.c> Header unset ETag </IfModule> # Since we’re sending far-future expires, we don’t need ETags for static content. # developer.yahoo.com/performance/rules.html#etags FileETag None # Send CORS headers if browsers request them; enabled by default for images. <IfModule mod_setenvif.c> <IfModule mod_headers.c> # mod_headers, y u no match by Content-Type?! <FilesMatch "\.(cur|gif|png|jpe?g|svgz?|ico|webp)$"> SetEnvIf Origin ":" IS_CORS Header set Access-Control-Allow-Origin "*" env=IS_CORS </FilesMatch> </IfModule> </IfModule> # Allow access to web fonts from all domains. <FilesMatch "\.(eot|otf|tt[cf]|woff2?)$"> <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" </IfModule> </FilesMatch> <IfModule mod_alias.c> <FilesMatch "\.(html|htm|rtf|rtx|txt|xsd|xsl|xml)$"> <IfModule mod_headers.c> Header set X-Powered-By "WP Rocket/3.6.0.1" Header unset Pragma Header append Cache-Control "public" Header unset Last-Modified </IfModule> </FilesMatch> <FilesMatch "\.(css|htc|js|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$"> <IfModule mod_headers.c> Header unset Pragma Header append Cache-Control "public" </IfModule> </FilesMatch> </IfModule> # Expires headers (for better cache control) <IfModule mod_expires.c> ExpiresActive on # Perhaps better to whitelist expires rules? Perhaps. ExpiresDefault "access plus 1 month" # cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5) ExpiresByType text/cache-manifest "access plus 0 seconds" # Your document html ExpiresByType text/html "access plus 0 seconds" # Data ExpiresByType text/xml "access plus 0 seconds" ExpiresByType application/xml "access plus 0 seconds" ExpiresByType application/json "access plus 0 seconds" # Feed ExpiresByType application/rss+xml "access plus 1 hour" ExpiresByType application/atom+xml "access plus 1 hour" # Favicon (cannot be renamed) ExpiresByType image/x-icon "access plus 1 week" # Media: images, video, audio ExpiresByType image/gif "access plus 4 months" ExpiresByType image/png "access plus 4 months" ExpiresByType image/jpeg "access plus 4 months" ExpiresByType image/webp "access plus 4 months" ExpiresByType video/ogg "access plus 1 month" ExpiresByType audio/ogg "access plus 1 month" ExpiresByType video/mp4 "access plus 1 month" ExpiresByType video/webm "access plus 1 month" # HTC files (css3pie) ExpiresByType text/x-component "access plus 1 month" # Webfonts ExpiresByType font/ttf "access plus 4 months" ExpiresByType font/otf "access plus 4 months" ExpiresByType font/woff "access plus 4 months" ExpiresByType font/woff2 "access plus 4 months" ExpiresByType image/svg+xml "access plus 1 month" ExpiresByType application/vnd.ms-fontobject "access plus 1 month" # CSS and JavaScript ExpiresByType text/css "access plus 1 year" ExpiresByType application/javascript "access plus 1 year" </IfModule> <IfModule mod_headers.c> # Serve gzip compressed CSS and JS files if they exist # and the client accepts gzip. RewriteCond "%{HTTP:Accept-encoding}" "gzip" RewriteCond "%{REQUEST_FILENAME}\.gz" -s RewriteRule "^(.*)\.(css|js)" "$1\.$2\.gz" [QSA] # Serve correct content types, and prevent mod_deflate double gzip. RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1] RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1] <FilesMatch "(\.js\.gz|\.css\.gz)$"> # Serve correct encoding type. Header append Content-Encoding gzip # Force proxies to cache gzipped & # non-gzipped css/js files separately. Header append Vary Accept-Encoding </FilesMatch> </IfModule> # Gzip compression <IfModule mod_deflate.c> # Active compression SetOutputFilter DEFLATE # Force deflate for mangled headers <IfModule mod_setenvif.c> <IfModule mod_headers.c> SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding # Don’t compress images and other uncompressible content SetEnvIfNoCase Request_URI \ \.(?:gif|jpe?g|png|rar|zip|exe|flv|mov|wma|mp3|avi|swf|mp?g|mp4|webm|webp|pdf)$ no-gzip dont-vary </IfModule> </IfModule> # Compress all output labeled with one of the following MIME-types <IfModule mod_filter.c> AddOutputFilterByType DEFLATE application/atom+xml \ application/javascript \ application/json \ application/rss+xml \ application/vnd.ms-fontobject \ application/x-font-ttf \ application/xhtml+xml \ application/xml \ font/opentype \ image/svg+xml \ image/x-icon \ text/css \ text/html \ text/plain \ text/x-component \ text/xml </IfModule> <IfModule mod_headers.c> Header append Vary: Accept-Encoding </IfModule> </IfModule> <IfModule mod_mime.c> AddType text/html .html_gzip AddEncoding gzip .html_gzip </IfModule> <IfModule mod_setenvif.c> SetEnvIfNoCase Request_URI \.html_gzip$ no-gzip </IfModule> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTPS} on [OR] RewriteCond %{SERVER_PORT} ^443$ [OR] RewriteCond %{HTTP:X-Forwarded-Proto} https RewriteRule .* - [E=WPR_SSL:-https] RewriteCond %{HTTP:Accept-Encoding} gzip RewriteRule .* - [E=WPR_ENC:_gzip] RewriteCond %{REQUEST_METHOD} GET RewriteCond %{QUERY_STRING} ="" RewriteCond %{HTTP:Cookie} !(wordpress_logged_in_.+|wp-postpass_|wptouch_switch_toggle|comment_author_|comment_author_email_) [NC] RewriteCond %{REQUEST_URI} !^(/(.+/)?feed/?|/(?:.+/)?embed/|/checkout-2/(.*)|/cart-2/|/my-account-2/(.*)|/wc-api/v(.*)|/(index\.php/)?wp\-json(/.*|$))$ [NC] RewriteCond %{HTTP_USER_AGENT} !^(facebookexternalhit).* [NC] RewriteCond "%{DOCUMENT_ROOT}/wp-content/cache/wp-rocket/%{HTTP_HOST}%{REQUEST_URI}/index%{ENV:WPR_SSL}%{ENV:WPR_WEBP}.html%{ENV:WPR_ENC}" -f RewriteRule .* "/wp-content/cache/wp-rocket/%{HTTP_HOST}%{REQUEST_URI}/index%{ENV:WPR_SSL}%{ENV:WPR_WEBP}.html%{ENV:WPR_ENC}" [L] </IfModule> # END WP Rocket # BEGIN WPSuperCache # The directives (lines) between "BEGIN WPSuperCache" and "END WPSuperCache" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. # END WPSuperCache # 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 # 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" 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/atelierb.ae/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
- The topic ‘Page caching seems not working for both dynamic and static pages.’ is closed to new replies.