1 Reply Latest reply on Jul 15, 2011 2:46 AM by deansy55

    HTTP Header function and Optimizing Image Caching

    Level 2

      HTTP header tags and Optimize Caching

      Google Labs has  a product out there called page speed that was recommended by in theWebmaster Tools Technical Guidelines. The product allows you to submit your URL and then it gives you feedback on what can be done to improve the site. One of the feed back suggestions, I got, recommended that I optimize my caching on all my static resources, such as images(.jpg) and style sheets(.css)

      Here is a sample below. The url entered was http://www.aimeecaprice.com/

      Suggestions for this page

      The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:

       

      Now here is my problem, I read the documentation and it talks about setting the expiry dates or the max-age in the HTTP headers. I honestly don't know where in my code, the HTTP headers are. I don't think it is in the head tag. They do give me sample of the syntax and how to write it, but I just am not sure where to place it. They are not talking about meta tags. Or setting caching with the meta tags This is something differnt. and I just can't visualize what it is suppose to like with the rest of my code. Does anybody use this and can you send me a sample of how your code looked in code view, Thanks

       

      Oh one more thing, I thing I am supposed to do this for each .jpg but I don't know how to specify each .jpg. I

       

      Thanks so much for all the help

       

      Sincerely,

      aimeecaprice

        • 1. Re: HTTP Header function and Optimizing Image Caching

          try this:

           

          <IfModule mod_expires.c>
          ExpiresActive On
          ExpiresByType text/html "access plus 1 seconds"
          ExpiresByType image/gif "access plus 1 years"
          ExpiresByType image/jpeg "access plus 1 years"
          ExpiresByType image/png "access plus 1 years"
          ExpiresByType image/x-icon "access plus 1 years"
          ExpiresByType text/css "access plus 1 years"
          ExpiresByType text/javascript "access plus 1 years"
          ExpiresByType application/x-javascript "access plus 1 years"
          ExpiresByType application/x-shockwave-flash "access plus 1 years"
          </IfModule>

           

          are you running on apache?

           

          i assume so if you are posting in the php development section of addt.

           

          to be honest your post would be better in the dreamweaver section not the addt to be honest but hopefully this will help you.

           

          just google "How to set date expiry on images"  you will get some good articles some bad.  run through until you find one which is easy to follow.