I am using newspaper theme and tagDiv Mobile Theme also. I have set caching using WP Super Cache and I have set all caching settings according to the guide – > https://forum.tagdiv.com/cache-plugin-install-and-configure/ . By the way, I am using Cloudflare and I have also set Cloudflare settings according to the guide -> https://forum.tagdiv.com/cloudflare-cdn/
I also set Browser cache TTL to 1 month in cloudflare
Apart from that I have added the following 3 page rules in Cloudflare
https://www.MyDomain.com/wp-admin*
Security Level: High, Cache Level: Bypass, Disable Apps, Disable Performance
https://www.MyDomain.com/wp-login.php*
Security Level: I’m Under Attack, Cache Level: Bypass, Disable Apps, Disable Performance
https://www.MyDomain.com/*
Cache Level: Cache Everything, Origin Cache Control: On
I have also set cache control header in .htaccess . Below is the code
# BEGIN Caching
<ifModule mod_headers.c>
<filesMatch “\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$”>
Header set Cache-Control “max-age=2592000, public”
</filesMatch>
<filesMatch “\\.(css)$”>
Header set Cache-Control “max-age=604800, public”
</filesMatch>
<filesMatch “\\.(js)$”>
Header set Cache-Control “max-age=216000, private”
</filesMatch>
<filesMatch “\\.(xml|txt)$”>
Header set Cache-Control “max-age=216000, public, must-revalidate”
</filesMatch>
<filesMatch “\\.(html|htm|php)$”>
Header set Cache-Control “max-age=1, private, must-revalidate”
</filesMatch>
</ifModule>
# END Caching
My response header for jpeg file is as below:
accept-ranges: bytes
cache-control: max-age=2592000, public
cache-control: no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0
cf-cache-status: BYPASS
cf-ray: 54988bd04b09c91c-HYD
content-length: 104228
content-type: image/jpeg
date: Mon, 23 Dec 2019 07:15:46 GMT
expect-ct: max-age=604800, report-uri=”https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct”
last-modified: Sun, 22 Dec 2019 07:58:16 GMT
server: cloudflare
status: 200
vary: Accept-Encoding
I have checked with my host and they have replied saying –
We checked the website and it’s currently using CloudFlare service for DNS and caching.
Also, the header reply for client’s site is also returned by CloudFlare server. What we can advise for this case is to correctly configure WordPress website for using CloudFlare for the headers to be correct.
Somehow Cloudflare’s CDN is not caching images and other files(cf-cache-status: BYPASS). Am I missing something here?