Title: Browser cache not working
Last modified: February 8, 2018

---

# Browser cache not working

 *  Resolved [tropicalista](https://wordpress.org/support/users/tropicalista/)
 * (@tropicalista)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/)
 * I have enabled the browser cache setting.
 * However I notice that the generated minified files that are served by `/min/generatedfile.
   css` are not sending cache control header.
 * I have also noticed that html is not gzipped.
 * Can you help me?
 * Thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbrowser-cache-not-working-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9952263)
 * hmmmmmm, could you disable all other plugins to try ? I just installed a WP 4.8.4
   with LSCWP 1.8.3 , all min/*.css are properly set cache header
 *  [Tishu](https://wordpress.org/support/users/tishu/)
 * (@tishu)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9952294)
 * Hello,
 * First of all i do not see litespeed cache to hit. Please check plugin settings
   and server settings.
 *  Thread Starter [tropicalista](https://wordpress.org/support/users/tropicalista/)
 * (@tropicalista)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9952477)
 * I was digging in the documentation and just discoverede that openlitespeed does
   not support htaccess.
 * Is this correct?
 * If so, I should add all the htaccess content on rewrite section of admin panel?
 *  Thread Starter [tropicalista](https://wordpress.org/support/users/tropicalista/)
 * (@tropicalista)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9952770)
 * Mmm…I’ve solved the htaccess problem by adding
 * `rewriteFile /usr/local/lsws/prestitiinpdap.it/html/.htaccess`
 * in rewrite section. Now `X-LiteSpeed-Cache: hit` is correctly sent.
 * The question now is:
 * Should I add `Header set Cache-Control "max-age=31536000, public"` to my files?
   Or is it suppesed to be handled by litespeed cache?
 *  Thread Starter [tropicalista](https://wordpress.org/support/users/tropicalista/)
 * (@tropicalista)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9953250)
 * Here’s my htaccess file:
 *     ```
       # 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 min/\w+\.(css|js) - [E=cache-control:no-vary]
   
       ### marker CACHE RESOURCE start ###
       RewriteRule LSCWP_CONTENT_FOLDER/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
       ### marker CACHE RESOURCE end ###
   
       ### marker LOGIN COOKIE start ###
       RewriteRule .? - [E="Cache-Vary:wp-postpass_6f658d45f2699b4444b0184733ddbf4b"]
       ### marker LOGIN COOKIE end ###
   
       ### marker FAVICON start ###
       RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
       ### marker FAVICON end ###
   
       ### marker BROWSER CACHE start ###
       <FilesMatch "\.(pdf|ico|svg|xml|jpg|jpeg|png|gif|webp|ogg|mp4|webm|js|css|woff|woff2|ttf|eot)(\.gz)?$">
       <IfModule mod_expires.c>
       ExpiresActive on
       ExpiresByType application/pdf A2592000
       ExpiresByType image/x-icon A2592000
       ExpiresByType image/vnd.microsoft.icon A2592000
       ExpiresByType image/svg+xml A2592000
   
       ExpiresByType image/jpg A2592000
       ExpiresByType image/jpeg A2592000
       ExpiresByType image/png A2592000
       ExpiresByType image/gif A2592000
       ExpiresByType image/webp A2592000
   
       ExpiresByType video/ogg A2592000
       ExpiresByType audio/ogg A2592000
       ExpiresByType video/mp4 A2592000
       ExpiresByType video/webm A2592000
   
       ExpiresByType text/css A2592000
       ExpiresByType text/javascript A2592000
       ExpiresByType application/javascript A2592000
       ExpiresByType application/x-javascript A2592000
   
       ExpiresByType application/x-font-ttf A2592000
       ExpiresByType application/x-font-woff A2592000
       ExpiresByType application/font-woff A2592000
       ExpiresByType application/font-woff2 A2592000
       ExpiresByType application/vnd.ms-fontobject A2592000
       ExpiresByType font/ttf A2592000
       ExpiresByType font/woff A2592000
       ExpiresByType font/woff2 A2592000
   
       </IfModule>
       </FilesMatch>
       ### marker BROWSER CACHE end ###
   
       </IfModule>
       ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
       # END LSCACHE
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteCond %{HTTPS} off
       # First rewrite to HTTPS:
       # Don't put www. here. If it is already there it will be included, if not
       # the subsequent rule will catch it.
       RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
       # Now, rewrite any request to the wrong domain to use www.
       # [NC] is a case-insensitive match
       RewriteCond %{HTTP_HOST} !^www\. [NC]
       RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
   
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
   
       # END WordPress
       ```
   
 *  Thread Starter [tropicalista](https://wordpress.org/support/users/tropicalista/)
 * (@tropicalista)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9953657)
 * And here’s my cache module config:
 *     ```
       enableCache 0
       enablePrivateCache 0
       checkPublicCache 1
       checkPrivateCache 1
       qsCache 1
       reqCookieCache 1
       ignoreReqCacheCtrl 1
       ignoreRespCacheCtrl 0
       respCookieCache 1
       expireInSeconds 3600
       privateExpireInSeconds 3600
       maxStaleAge 200
       maxCacheObjSize 10000000
       storagepath cachedata
       noCacheDomain
       noCacheUrl
       no-vary 0
       addEtag 0
       ```
   
 *  Thread Starter [tropicalista](https://wordpress.org/support/users/tropicalista/)
 * (@tropicalista)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9954673)
 * Further informations: if you go on [https://www.prestitiinpdap.it/mutui-inpdap/](https://www.prestitiinpdap.it/mutui-inpdap/)
   you see that image have `cache-control` but it’s not hit by litespeed cache.
 * However css and js doesn’t have any expires header.
 *  Thread Starter [tropicalista](https://wordpress.org/support/users/tropicalista/)
 * (@tropicalista)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9954824)
 * Seems a bug on openlitespeed. I’d like to have help on this. I can create a user
   and give access to check if it’s my misunderstanding of server settings or a 
   serious bug.
 *  Plugin Support [LiteSpeed Lisa](https://wordpress.org/support/users/lclarke/)
 * (@lclarke)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9956835)
 * Hi, [@tropicalista](https://wordpress.org/support/users/tropicalista/)
 * Thank you for all of the updates and details you’ve sent so far.
 * > Should I add Header set Cache-Control “max-age=31536000, public” to my files?
   > Or is it suppesed to be handled by litespeed cache?
 * Once you enable Browser Cache (at the bottom of **LiteSpeed Cache > Settings 
   > Cache**), the headers will be taken care of for you. You don’t need to do anything
   else.
 * > Further informations: if you go on [https://www.prestitiinpdap.it/mutui-inpdap/](https://www.prestitiinpdap.it/mutui-inpdap/)
   > you see that image have cache-control but it’s not hit by litespeed cache.
 * I visited the link and I _do_ see `x-litespeed-cache:hit`. If you don’t, it’s
   possible you are logged in and you have **Cache Logged-In Users** set to `OFF`.
   Try viewing your page from an incognito window and see if it behaves the way 
   you would like it to behave.
 * Let us know if things are still not right from the incognito window, and what,
   specifically, is still not working.
 *  Plugin Support [LiteSpeed Lisa](https://wordpress.org/support/users/lclarke/)
 * (@lclarke)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9956854)
 * I just noticed you’re getting some help [in our main forum](https://www.litespeedtech.com/support/forum/threads/setting-expires-cache-control-headers-seems-buggy.15964/),
   so I’ll go ahead and close this post to avoid duplicate effort.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Browser cache not working’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

## Tags

 * [browser cache](https://wordpress.org/support/topic-tag/browser-cache/)

 * 10 replies
 * 4 participants
 * Last reply from: [LiteSpeed Lisa](https://wordpress.org/support/users/lclarke/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/browser-cache-not-working-3/#post-9956854)
 * Status: resolved