Support » Plugin: LiteSpeed Cache » ExpiresDefault error message – remove from .htaccess file?

  • Resolved HMSRE


    Just updated to Version 1.1.4 today and getting an error:

    ERROR 4010: In .htaccess file found one unexpected cache rule ExpiresDefault l

    This is what I currently have in my .htaccess file (which I thought is helpful to speed test results and performance).

    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg “access plus 1 year”
    ExpiresByType image/jpeg “access plus 1 year”
    ExpiresByType image/gif “access plus 1 year”
    ExpiresByType image/png “access plus 1 year”
    ExpiresByType text/css “access plus 1 month”
    ExpiresByType application/pdf “access plus 1 month”
    ExpiresByType text/x-javascript “access plus 1 month”
    ExpiresByType application/x-shockwave-flash “access plus 1 month”
    ExpiresByType image/x-icon “access plus 1 year”
    ExpiresDefault “access plus 2 days”

    What’s the reason in removing this from my .htaccess file? Does Litespeed handle this in the plugin vs .htaccess? Thx.


Viewing 5 replies - 16 through 20 (of 20 total)
  • Hi Hai,
    Litespeed Cache really a wonderful plug in.
    Actually, I have a review post that compares speed between WP Rocket and Litespeed Cache in my Blog (Vietnamese blog).
    The result is so surprising:
    Your plug in is better than WP rocket in case hosting support Litespeed Web Service.
    Would like recommend using Litespeed Plugin.
    High quality but free.

    Hi, guys,

    I do have a few remarks about this new feature.

    1. If Litespeed urges me to remove my htaccess ExpiresDefault clause then how can I control it if I want? Is there some other setting somewhere else?

    2. If I add the ExpiresByType text/html "access plus 0 seconds" clause then does this mean that i must have my HTML content uncached? Why would I want to be forced to do this?

    3. UI-wise this is not a warning, as you mention, it is an error and one that doesn’t go away.

    4. Is adding spaces before the ExpiresByType clause the intended way to disable this message? If so, then I must say this is a rather unusual and not very developer-friendly way.

    Thank you very much in advance! Other than this peculiar little update the plugin is amazing.


    Plugin Author Hai@LiteSpeed⚡


    Hi @nevma,

    1. We did get couple bug feedback from users due to this rule, so we added a check to make users aware. If you are very sure it will not affect your current site, you can do the trick to make that check gone.

    2. PHP scripts are using same type as html. Same as 1), if you want you can still keep using them but one your visitors get the old cache version issue, you may need to remove it.

    3.&4. For some e-commerce sites, it could be a serious issue for experience. That’s why we made it an error not a warning. But if you have any suggestion we would be very glad to hear.


    Plugin Author LiteSpeed Technologies


    Hello Nevma,

    Apologies on our end as this feature was implemented a little clumsily and should work differently in our next version. I’ll try and address your concerns in order.

    1. The idea behind removing this line is that it was likely left behind by another cache plugin when switching to LiteSpeed Cache. If this is not the case or it is intentional, then it should not be removed (more info in point 2).

    2. Adding this line does not disable caching, it disables browser caching for HTML files (the finished page). The reason for this is that LiteSpeed Cache is a full page cache, so once the page is generated it is then cached and served directly for others without the need to re-generate. The problem with not having ExpiresByType text/html "access plus 0 seconds" is that if ExpiresDefault is set or ExpiresByType text/html is set to a value other than 0, the page will be cached again by the browser. So later on when you modify the post (for example) and LiteSpeed Cache intelligently purges that now outdated cache entry, all of your visitors whose browsers have cached the previous copy will continue to see the outdated copy until their browser cache expires or is cleared.

    3 & 4. Sorry about that, for now please add a space before ExpiresDefault to avoid the message until our next version is out. This should no longer be necessary at that time.

    Glad to hear you like the plugin! Once we fix this little annoyance your experiencing we would appreciate it if you could leave us a review if you have not already 🙂


    Side note for LS – only thing I regret about the plugin is that my host (A2hosting) doesn’t support crawling for their shared plans. Not your issue, but they could easily productize that and I would be FIRST in line to buy it. Just a suggestion on helping them create such a feature with some case studies of which I’d be happy to work with you guys one since I do have more pages than most will ever have… and I only ask for a 3% referral fee for the shared hosting product idea – hahaha.

    Again, you guys rock.


Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘ExpiresDefault error message – remove from .htaccess file?’ is closed to new replies.