GaVrA Posted May 17, 2009 Posted May 17, 2009 I am fine tuning my forum, and iv been using YSlow to help me with that. One of the things where i got an F is "Add Expires headers" so i am wandering how hard could that be to fix it... :) There is bunch of text here: http://developer.yahoo.com/performance/rules.html#expires but i dont understand how to implement this?
Iris Posted May 18, 2009 Posted May 18, 2009 A first-time visitor to your page will make several HTTP requests to download all your sites files, but using the Expires header you make those files cacheable. This avoids unnecessary HTTP requests on subsequent page views. Expires headers should be used on all components including scripts, stylesheets, and Flash components If you see my tut about very good htaccess file in tutorials section here then the last part is all about expires. http://www.invisionbyte.net/index.php?auto...;showarticle=65 extract from it ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType text/html "access plus 1 seconds" ExpiresByType image/gif "access plus 120 minutes" ExpiresByType image/jpeg "access plus 120 minutes" ExpiresByType image/png "access plus 120 minutes" ExpiresByType text/css "access plus 60 minutes" ExpiresByType text/javascript "access plus 60 minutes" ExpiresByType application/x-javascript "access plus 60 minutes" ExpiresByType text/xml "access plus 1 seconds" so basicly you use the visitors browsers cache for serving graphics and more.example, i visit your site, with the instruction my browser downloads a lot of things to store in my browsers cache, for me the first page will be a little slow, but then everything speeds up, because all that is downloaded in my cache is served from my cache and not your site anymore.benefits, you less bandwidth, me speedier websiteyou see in extract, that images like jpg and gif are stored in my browsers cache for more then 120 minutes.rest is self explicatory. I use this on my site, which is in my signature, so first load is a bit slow and then it speeds up for the reasons explained above. http://www.xxx-devils.com/DevilsLair/4thBanner.jpgVisit My TopListVisit My Pagerank Toplist
Iris Posted May 18, 2009 Posted May 18, 2009 secondly i want to add, that speed gain is also gained by compressing, so you apply what i wrote above and then you start compressing, html, php, css, java, gifs jpgs etc.smalles sizes ,faster site ,less bandwidth everyone happy. http://www.xxx-devils.com/DevilsLair/4thBanner.jpgVisit My TopListVisit My Pagerank Toplist
GaVrA Posted May 18, 2009 Author Posted May 18, 2009 Uff i hate when i want to learn something new but i just dont have time for it... :D Ok so based on ur tut and this: http://developer.yahoo.com/performance/rules.html#expires i now have .htaccess just like the one u posted in that tut but everything is on "access plus 10 years". Only text/html and text/xml is on "access plus 1 seconds". YSlow reported that i had hmm 76 components without a far-future expiration date and now there is only 13 of them... :) Ok now i dont understand why it wont add "access plus 10 years" on javascript files and css file? Also how can i add a far-future expiration date for favicon? :huh:
Iris Posted May 18, 2009 Posted May 18, 2009 10 years is unreasonable, you must think in hours and daysfavicon is so small that it is not worth the trouble, what is size less then 1 kb.... http://www.xxx-devils.com/DevilsLair/4thBanner.jpgVisit My TopListVisit My Pagerank Toplist
GaVrA Posted May 18, 2009 Author Posted May 18, 2009 I was just following this: http://developer.yahoo.com/performance/rules.html#expires and this http://developer.yahoo.net/blog/archives/2...rformanc_2.html :) You have any idea why those 13 components wont get "far-future expiration date"? :huh:
Iris Posted May 18, 2009 Posted May 18, 2009 ok which 13 components dont work? http://www.xxx-devils.com/DevilsLair/4thBanner.jpgVisit My TopListVisit My Pagerank Toplist
GaVrA Posted May 18, 2009 Author Posted May 18, 2009 http://www.invisionbyte.net/index.php?act=...post&id=264
Iris Posted May 18, 2009 Posted May 18, 2009 i think Minify JS This one required a little work. I installed YUI compressor and created a batch file. I also used this batch file to combine my javascript files into one file, before compressing it; and I used it to compress my main CSS files too. http://www.xxx-devils.com/DevilsLair/4thBanner.jpgVisit My TopListVisit My Pagerank Toplist
Iris Posted May 19, 2009 Posted May 19, 2009 css and js remains a b*tch, yslow wants a certain method applied but it is not possible to apply that method always, certain pages i can get on grade A and certain are lower.I use manual compression on css and js see http://www.cssdrive.com/index.php/main/csscompressor/ that makes my css very small, and altough yslow may not pick it up, i benefit anyways, same principle for js files http://www.xxx-devils.com/DevilsLair/4thBanner.jpgVisit My TopListVisit My Pagerank Toplist
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now