Hit cache in first visit
-
Hi! I have a problem, because cache on my website only work when I refresh it. I mean when I first visit my website there is no cache version, it only appears after I refresh the page. What options do I need to change to make the cached version work as soon as I first access the site?
Number of my report: CWDHYDAZ
- This topic was modified 2 years ago by omertapl.
-
No, I am not logged in. I am testing this on a browser in incognito mode on which this site has never been run (in addition, I have cleared all cache and cookies).
Don’t use incognito mode!
Did you enable mobile view, webp replacement and|or guestmode? If yes, which one do you have enabled?
Don’t use incognito mode!
Why?
Did you enable mobile view, webp replacement and|or guestmode? If yes, which one do you have enabled?
WEBP and guestmode, mobile view is disable.
Why?
That falsifies the result.
WEBP and guestmode, mobile view is disable.
Please post cache plugin .htaccess settings and tell me which browser do you use.
- This reply was modified 2 years ago by serpentdriver.
I tested it on Chrome, Opera, Safari and Firefox – the latest available version.
Here’s the httaccess settings:
# BEGIN LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## <IfModule LiteSpeed> RewriteEngine on CacheLookup on RewriteRule .* - [E=Cache-Control:no-autoflush] RewriteRule \.litespeed_conf\.dat - [F,L] ### marker MOBILE start ### RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC] RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+ismobile] ### marker MOBILE end ### ### marker CACHE RESOURCE start ### RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600] ### marker CACHE RESOURCE end ### ### marker FAVICON start ### RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400] ### marker FAVICON end ### ### marker WEBP start ### RewriteCond %{HTTP_ACCEPT} "image/webp" RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp] RewriteCond %{HTTP_USER_AGENT} iPhone.*Version/(\d{2}).*Safari RewriteCond %1 >13 RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp] ### marker WEBP end ### ### marker DROPQS start ### CacheKeyModify -qs:fbclid CacheKeyModify -qs:gclid CacheKeyModify -qs:utm* CacheKeyModify -qs:_ga ### marker DROPQS end ### </IfModule> ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## # END LSCACHE # BEGIN NON_LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## ### marker BROWSER CACHE start ### <IfModule mod_expires.c> ExpiresActive on ExpiresByType application/pdf A31557600 ExpiresByType image/x-icon A31557600 ExpiresByType image/vnd.microsoft.icon A31557600 ExpiresByType image/svg+xml A31557600 ExpiresByType image/jpg A31557600 ExpiresByType image/jpeg A31557600 ExpiresByType image/png A31557600 ExpiresByType image/gif A31557600 ExpiresByType image/webp A31557600 ExpiresByType video/ogg A31557600 ExpiresByType audio/ogg A31557600 ExpiresByType video/mp4 A31557600 ExpiresByType video/webm A31557600 ExpiresByType text/css A31557600 ExpiresByType text/javascript A31557600 ExpiresByType application/javascript A31557600 ExpiresByType application/x-javascript A31557600 ExpiresByType application/x-font-ttf A31557600 ExpiresByType application/x-font-woff A31557600 ExpiresByType application/font-woff A31557600 ExpiresByType application/font-woff2 A31557600 ExpiresByType application/vnd.ms-fontobject A31557600 ExpiresByType font/ttf A31557600 ExpiresByType font/otf A31557600 ExpiresByType font/woff A31557600 ExpiresByType font/woff2 A31557600 </IfModule> ### marker BROWSER CACHE end ### ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## # 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
.htaccess seems to be okay and matches to your settings, so there is no reason why the warmup with the crawler shouldn’t work.
Either you are checking the cache wrong or you still don’t understand the cache status. When the crawler has finished crawling, the cache status MUST be “hit” in any case. This works wonderfully for the other 3 million users of the cache plugin.
Yes, I know that the cache status should have “hit”. But it just doesn’t, as in the screen shot I gave you a few comments ago you can see that half of the links are marked as “miss” (blue color). Why is this happening, why doesn’t the crawler go through every single page and give a “hit” status (i.e. it does a static, cached version)?
Again, blue and status 200 means the crawler has requested the URL successfully. Cache status changes after next request, but the URL is already cached. If it is not 200 or URL is excluded from being cached the status is no-cache.
Again, again and again if a page isn’t cached you always get a miss header first, because the server shows the current status “BEFORE” the URL is cached and not after the request. You should be able to tell the difference in the loading time.
Okay, then why is it that when I first load a page that is marked as 200 (blue status) its loading time is a few seconds, and only when I refresh it again does it load faster? I keep asking, how do I change the settings so that ALL addresses on my site have a “hit” status? Because now it doesn’t work, unfortunately.
There is no logical reason for it, at least judging by your settings. To find out a possible cause, you would need direct access to your server or WP Admin.
Unfortunately, you have not comforted me ??
Oooooh, poor boy!
Better? ??
Not really ??
I would really like to help you, but the facts currently do not allow us to recognize that anything is wrong. Your settings are correct and the .htaccess is also correct. Logically, there can be no problems. I need direct access to your WP admin to find out where the problem could be. Could you tell me the URL of your site?
Unfortunately, I am not authorized to paste the test site address publicly. I know it’s hard to help anything without it.
- The topic ‘Hit cache in first visit’ is closed to new replies.