Cache-Control:max-age ignored




Wordpress LScache Plugin: Cache-Control:max-age ignored

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hello, Can someone help me out what is the maximum value of Cache-Control:max-age ? The problem i am experiencing is that by using the plugin or without the plugin the cache-control:max-age parameter ignores any value above 600. Everything works as it should be BUT when i set RewriteRule . ? [E=Cache-Control:max-age=86400] it justs ignores it and keeps the cache only for 10 minutes or 600 seconds. When i hit the webpage for the first time i get X-Litespeed-Cache: miss in response header After few seconds in another tab when i visit webpage for second time i get X-Litespeed-Cache: hit . The problem is that if i wait for more than 10 minutes (600 seconds) when i visit the webpage for the third time i get X-Litespeed-Cache: miss which is NOT the desired behavior. I should get X-Litespeed-Cache: hit ?>see below my .htaccess file. I would be more than helpful if someone could point me to a solution [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ] #CacheEnable public / CacheLookup public on RewriteEngine on RewriteCond % REQUEST_METHOD ^(HEAD|GET)$ RewriteCond % REQUEST_URI !^/(wp-admin|wp-login.php|wp-cron.php) RewriteRule . ? [E=Cache-Control:max-age=86400] # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index .php$ ? [L] RewriteCond % REQUEST_FILENAME !-f RewriteCond % REQUEST_FILENAME !-d RewriteRule . /index.php [L] # END WordPress Expand Hello linusgr, The max age you are setting through rewrite rules is likely being overridden by the value set in the LiteSpeed Cache for WordPress plugin. Try 1) Login in to your WordPress Admin Dashboard 2) Navigate to LiteSpeed Cache Settings 3) Under the General tab, set Default Public Cache TTL to 86400. Regards, -Michael Thank you for your quick answer Unfortunately it did not work :(.I got again X-Litespeed-Cache: miss after 10 minutes Do you know if Litespeed server can have a fixed value so this is the reason that htaccess cannot ovveride it ? Also maybe there is a configuration issue in htaccess file.. The corresponding htaccess file now is below IfModule LiteSpeed> #CacheEnable public / CacheLookup public on RewriteEngine on ###LSCACHE START RESOURCE### RewriteRule wp-content/. /(loader|fonts) .php - [E=cache-control:max-age=3600] ###LSCACHE END RESOURCE### ###LSCACHE START FAVICON### RewriteRule favicon .ico$ - [E=cache-control:max-age=86400] ###LSCACHE END FAVICON### RewriteCond % REQUEST_METHOD ^(HEAD|GET)$ RewriteCond % REQUEST_URI !^/(wp-admin|wp-login.php|wp-cron.php) RewriteRule . - [E=Cache-Control:max-age=86400] # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index .php$ - [L] RewriteCond % REQUEST_FILENAME !-f RewriteCond % REQUEST_FILENAME !-d RewriteRule . /index.php [L] # END WordPressExpand Hello, Just an update on the support ticket. The solution was given by the hosting provider by re-configuring the LiteSpeed public cache. Now the public cache is per user account instead of a central one Thanks for your time Hi linusgr, Sorry about the lack of response! With the changes to the support forum, we missed your prior message. Glad to hear everything is working now. Let us know when you encounter any issues! Cheers, Kevin



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference