• Resolved kanikam15

    (@kanikam15)


    Hello,

    I get this error-“Specify a cache validator” in GTMetrix report for all the images that i have on my page-www.sgbiosciences.com. GTMetrix Link: https://gtmetrix.com/reports/www.sgbiosciences.com/Ngh7PkT2
    Below is my htaccess code to check if something is wrong:

    # 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
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress
    # BEGIN ShortPixelWebp
    # The directives (lines) between BEGIN ShortPixelWebp and END ShortPixelWebp are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    # END ShortPixelWebp
    # BEGIN WP-Optimize Browser Cache
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css “access 1 year 1 day”
    ExpiresByType text/html “access 1 year 1 day”
    ExpiresByType image/gif “access 1 year 1 day”
    ExpiresByType image/png “access 1 year 1 day”
    ExpiresByType image/jpg “access 1 year 1 day”
    ExpiresByType image/jpeg “access 1 year 1 day”
    ExpiresByType image/webp “access 1 year 1 day”
    ExpiresByType image/x-icon “access 1 year 1 day”
    ExpiresByType application/pdf “access 1 year 1 day”
    ExpiresByType application/javascript “access 1 year 1 day”
    ExpiresByType text/x-javascript “access 1 year 1 day”
    ExpiresByType application/x-shockwave-flash “access 1 year 1 day”
    ExpiresDefault “access 1 year 1 day”
    </IfModule>

    <IfModule mod_headers.c>
    <filesMatch “\.(ico|jpe?g|png|gif|webp|swf)$”>
    Header set Cache-Control “public”
    </filesMatch>
    <filesMatch “\.(css)$”>
    Header set Cache-Control “public”
    </filesMatch>
    <filesMatch “\.(js)$”>
    Header set Cache-Control “private”
    </filesMatch>
    <filesMatch “\.(x?html?|php)$”>
    Header set Cache-Control “private, must-revalidate”
    </filesMatch>
    </IfModule>

    #Disable ETag
    FileETag None
    # END WP-Optimize Browser Cache

    • This topic was modified 5 years ago by kanikam15.

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

Viewing 1 replies (of 1 total)
  • Hi there,

    The images on the linked website are hosted on cdn.shortpixel.ai, and are hense not affected by the settings in the .htaccess.

    screenshot

    You may want to check this with shortpixel’s support.

    Marc.

Viewing 1 replies (of 1 total)
  • The topic ‘how to fix specify cache validator in gtmetrix report’ is closed to new replies.