Jump to content

Recommended Posts

Posted

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?

Posted
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 website

you 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.jpg

Visit My TopList

Visit My Pagerank Toplist

Posted

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.jpg

Visit My TopList

Visit My Pagerank Toplist

Posted

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:

post-29-1242640386_thumb.png

Posted

10 years is unreasonable, you must think in hours and days

favicon is so small that it is not worth the trouble, what is size less then 1 kb....

http://www.xxx-devils.com/DevilsLair/4thBanner.jpg

Visit My TopList

Visit My Pagerank Toplist

Posted

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.jpg

Visit My TopList

Visit My Pagerank Toplist

Posted

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.jpg

Visit My TopList

Visit My Pagerank Toplist

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.