Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,587
    Plugin Contributions
    29

    Default Page assets NOT caching

    I can't figure out why page assets aren't being cached. I've used the steps here:
    https://www.zen-cart.com/content.php...ng-page-assets

    and here (currently in use):
    http://gtmetrix.com/leverage-browser-caching.html

    In both cases, css and js files are not being cached. It also says that a cache validator has not been set for gif files.

    http://gtmetrix.com/reports/shopasgo...d.com/a2FxcxvI

    The entire .htaccess is

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www\.shopasgoodasgold\.com$
    RewriteRule ^/?$ "http\:\/\/shopasgoodasgold\.com\/" [R=301,L]

    Redirect 301 /contest/index.html http://shopasgoodasgold.com/index.ph...ndex&cPath=8_1

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

  2. #2
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: Page assets NOT caching

    I have had this issue when the server does not support mod_expires

  3. #3
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,247
    Plugin Contributions
    58

    Default Re: Page assets NOT caching

    Or of mod_deflate is not enabled, also I prefer the following for your htaccess... note that some servers will need this in the assets directory such as includes/templates/your_template/css/

    Code:
    ExpiresActive On
    ExpiresDefault A2592000 
    <FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf|swf|mov|mp3|wmv|ppt|mpg|pdf|eot|svg|ttf|woff)$">
      ExpiresDefault A29030400
    Header set Cache-Control "max-age=604800, public"
    </FilesMatch>
    <FilesMatch "\.(xml|txt|html|js|css)$">
      ExpiresDefault A2592000 
    Header set Cache-Control "max-age=604800, public"
    </FilesMatch>
    <FilesMatch "\.(php|cgi|pl|htm|html)$">
      ExpiresDefault A0
      Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
      Header set Pragma "no-cache"
    </FilesMatch>
    <ifmodule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
    </ifmodule>
    ~Melanie
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  4. #4
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,587
    Plugin Contributions
    29

    Default Re: Page assets NOT caching

    If in the assets directory, is it still saved as an .htaccess file?

  5. #5
    Join Date
    Nov 2007
    Location
    Woodbine, Georgia, United States
    Posts
    4,247
    Plugin Contributions
    58

    Default Re: Page assets NOT caching

    yes, .htaccess
    PRO-Webs, Inc. since 2003 :: Zen Cart Hosting :: Zen Cart SEO – 12 Steps to Success
    **I answer questions in the forum, private messages are not conducive to a helpful community.

  6. #6
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,587
    Plugin Contributions
    29

    Default Re: Page assets NOT caching

    Thanks for confirming.

    I've tried your code (adding it to includes/templates/your_template/css/ didn't make a difference) and it's now reporting that content is being cached! Very oddly though, it says a validator is not specified for gif and png.

 

 

Similar Threads

  1. Replies: 6
    Last Post: 11 May 2015, 12:44 PM
  2. my host tells me I need to add page caching
    By widget40 in forum General Questions
    Replies: 2
    Last Post: 25 Aug 2010, 10:38 AM
  3. Enable browser caching of static assets
    By yd29999 in forum Basic Configuration
    Replies: 4
    Last Post: 10 Apr 2010, 10:16 PM
  4. File caching
    By inlikeflin in forum General Questions
    Replies: 7
    Last Post: 19 Jan 2008, 03:08 PM

Posting Permissions

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