Welcome to TalkGraphics.com
Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    20,899

    Default Despite having <IfModule mod_expires.c> within my .htaccess file ....

    Despite having <IfModule mod_expires.c> within my .htaccess file I still get marked down using pingdom and google lighthouse for not having them. I can't understand this, can anyone assist please.

    UPDATE Only showing on pingdom now.

    Here's the content of my .htaccess file:

    ErrorDocument 404 https://parkeston.com/404.htm

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 week"
    ExpiresByType image/@2xjpg "access 1 week"
    ExpiresByType image/jpeg "access 1 week"
    ExpiresByType image/gif "access 1 week"
    ExpiresByType image/png "access 1 week"
    ExpiresByType image/@2xpng "access 1 week"
    ExpiresByType image/webp "access 1 week"
    ExpiresByType image/@2xwebp "access 1 week"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType application/javascript "access 1 month"
    ExpiresByType application/jquery.js "access 1 month"
    ExpiresByType application/roe.js "access 1 month"
    ExpiresByType application/prs4.js "access 1 month"
    ExpiresByType application/ani.css "access 1 month"
    ExpiresByType application/xr_main.css "access 1 month"
    ExpiresByType application/xr_text.css "access 1 month"
    ExpiresByType application/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 year"
    ExpiresByType image/x-icon "access 1 year"
    </IfModule>
    ## EXPIRES CACHING##
    Last edited by Egg Bramhill; 11 October 2021 at 11:10 PM. Reason: update
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    14,347

    Default Re: Despite having <IfModule mod_expires.c> within my .htaccess file ....

    Egg, it looks clean. Do check the quotes are using the same and correct glyph; MS Word & Xara both use smart quotes! Also check EOL is right CRLF vs LF.

    Acorn
    Acorn - installed and active Xara software: Cloud+/Pro+, XDPX, XWD Premium 15 & 12, XPGD10, X3D7, Xara Xtreme 5, back through time (to CC's Artworks).
    Raise software faults with MagiXara: http://support.magix.net/; if Cloud+/Pro+: https://xara.com/contact-us/

  3. #3
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    20,899

    Default Re: Despite having <IfModule mod_expires.c> within my .htaccess file ....

    Thanks Acorn. I ran it through an .htaccess checker and it shows no faults. I'll look again later.
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  4. #4
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    14,347

    Default Re: Despite having <IfModule mod_expires.c> within my .htaccess file ....

    Egg, the only other things I thought of were the .htaccess file is in the index_htm_files folder and caching on your server.

    pingdom not working could be a slow distribution around edge servers/DNS, if you use something like Cloudflare.

    Acorn
    Acorn - installed and active Xara software: Cloud+/Pro+, XDPX, XWD Premium 15 & 12, XPGD10, X3D7, Xara Xtreme 5, back through time (to CC's Artworks).
    Raise software faults with MagiXara: http://support.magix.net/; if Cloud+/Pro+: https://xara.com/contact-us/

  5. #5
    Join Date
    Jul 2015
    Location
    Pennsylvania, USA
    Posts
    24

    Default Re: Despite having <IfModule mod_expires.c> within my .htaccess file ....

    I may be misunderstanding things, and that's quite likely, but where you have for the - ExpiresByType - and then - image/jpg "access 1 week", you're telling it to cache files with the extension of "jpg", correct? So something like Photo.jpg or Whatever.jpg would get cached.

    But then I noticed you also put in a line to tell it to cache the Type - image/@2xjpg. So I thought I better add that to my htaccess. But then I was thinking (which can be dangerous) --

    When you tell Xara you want to use images for the Retina display, then it makes a file that it adds "@2x". But, and I just checked this on my website, Xara adds the @2x to the file name, not to the file extension. So you get Photo@2x.jpg, not Photo.@2xjpg. So Photo@2x.jpg is still a jpg file extension which will be cached under the regular command to cache jpg files.

    Am I thinking correctly here? Do you need to add the - Type image/@2xjpg? And the same question goes for the @2xpng and @2xwebp. Because Photo@2x.png is still a regular png file that will be cached. No?

  6. #6
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    14,347

    Default Re: Despite having <IfModule mod_expires.c> within my .htaccess file ....

    Quote Originally Posted by MarkyW48 View Post
    I may be misunderstanding things, and that's quite likely, but where you have for the - ExpiresByType - and then - image/jpg "access 1 week", you're telling it to cache files with the extension of "jpg", correct? So something like Photo.jpg or Whatever.jpg would get cached.

    But then I noticed you also put in a line to tell it to cache the Type - image/@2xjpg. So I thought I better add that to my htaccess. But then I was thinking (which can be dangerous) --

    When you tell Xara you want to use images for the Retina display, then it makes a file that it adds "@2x". But, and I just checked this on my website, Xara adds the @2x to the file name, not to the file extension. So you get Photo@2x.jpg, not Photo.@2xjpg. So Photo@2x.jpg is still a jpg file extension which will be cached under the regular command to cache jpg files.

    Am I thinking correctly here? Do you need to add the - Type image/@2xjpg? And the same question goes for the @2xpng and @2xwebp. Because Photo@2x.png is still a regular png file that will be cached. No?
    You are probably right but it should not interfere with the other statements.

    Acorn
    Acorn - installed and active Xara software: Cloud+/Pro+, XDPX, XWD Premium 15 & 12, XPGD10, X3D7, Xara Xtreme 5, back through time (to CC's Artworks).
    Raise software faults with MagiXara: http://support.magix.net/; if Cloud+/Pro+: https://xara.com/contact-us/

  7. #7
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    20,899

    Default Re: Despite having <IfModule mod_expires.c> within my .htaccess file ....

    @ Acorn, I apologise, I did answer your earlier post but it seems to have gone awol.

    @ Marky Yes you are 100% correct, I'm overcomplicating the issue! Here's my amended expire headers.

    Contacted my web host to see if they can throw light on the issue

    ErrorDocument 404 https://parkeston.com/404.htm

    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 week"
    ExpiresByType image/jpeg "access 1 week"
    ExpiresByType image/gif "access 1 week"
    ExpiresByType image/png "access 1 week"
    ExpiresByType image/webp "access 1 week"
    ExpiresByType text/css "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType application/javascript "access 1 month"
    </IfModule>
    ## EXPIRES CACHING##
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  8. #8
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    20,899

    Default Re: Despite having <IfModule mod_expires.c> within my .htaccess file ....

    Still getting nowhere with this. It appears that expires headers can't handle webp images. See attached results below. Although the webp are supposed to be cached and states they are they clearly aren't as shown in the non cached list. Go figure.

    I've given up on Pingdom re this issue as no matter what you do (don't use webp for example) Pingdom gives the same result every time

    I checked this on LINK
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	EXPORT.png 
Views:	18 
Size:	214.5 KB 
ID:	130878  
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

  9. #9
    Join Date
    Apr 2010
    Location
    Kildare, Ireland
    Posts
    874

    Default Re: Despite having <IfModule mod_expires.c> within my .htaccess file ....

    Maybe it wants a 365 day cache period, not a week or month. Just bear in mind images need to be renamed if changed otherwise visitors might not see the latest image for a year or until they did a full page refresh in the browser.
    XT-CMS - a self-hosted CMS for Xara Designers - Xara + CMS Demo with blog & ecommerce shopping cart system.

  10. #10
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    20,899

    Default Re: Despite having <IfModule mod_expires.c> within my .htaccess file ....

    I tried that in the image above your post Tom i.e. using 365 days. but whilst it appears to read the webp webcache from the .htaccess file it then goes on to state these files are not cached.
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •