• Resolved Xandro

    (@sudarshankotian)


    Hi, I am getting this error on my WordPress dashboard

    > Unexpected cache rule ExpiresDefault found in .htaccess file. This rule may cause visitors to see old versions of pages due to the browser caching HTML pages. If you are sure that HTML pages are not being browser cached, this message can be dismissed.

    You can check the image here > https://prnt.sc/22rqDqVOi0o_

    I found this on my websites .htaccess file >

    ## EXPIRES HEADER CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType image/svg "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType application/javascript "access 1 month"
    ExpiresByType application/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
    </IfModule>
    ## EXPIRES HEADER CACHING ##

    Do I need to all of this code? or just > ExpiresDefault “access 2 days”

    You can check the screenshot here > https://prnt.sc/sw70A-S982tq

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • FYI: Expires has nothing to with LiteSpeed cache. It’s a Apache directive that controls cache behaviour for static sources like images. Expires Directive controls the overall time to live for static sources and you should leave it. But again, it has nothing to do with cache plugin.

    https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    suggest to remove all cache-related rules that is not generated by LSCWP

    best regards,

    Thread Starter Xandro

    (@sudarshankotian)

    That means I have to remove all of this below code right?

    ## EXPIRES HEADER CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType image/svg "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType application/javascript "access 1 month"
    ExpiresByType application/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 2 days"
    </IfModule>
    ## EXPIRES HEADER CACHING ##

    Or just this? > ExpiresDefault “access 2 days”

    That means I have to remove all of this below code right?

    No, although plugin support gives other suggestion. Expire and Cache-Control headers are Must Have Basics for ergonomic handling of caching for static sources.

    If you remove Expire headers it will not prevent that users see old images, because there is a more important cache header: “Cache-Control” header is responsible how long images and other static sources are cached in browser. You can change the Time To Live how long images are cached in browser, but if you decrease this time you will get bad Pagespeed score, because Pagespeed expects 1 year or 31536000 seconds.

    Thread Starter Xandro

    (@sudarshankotian)

    Okay, Thank you @serpentdriver for the clarity on this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Unexpected cache rule `ExpiresDefault` found in .htaccess file’ is closed to new replies.