Thursday, May 6, 2010

More Website speed and optimisation links, http headers

This is basically the caching issue im having, except on safari. something is causing it to redraw randomly, sometimes. the site is a wordpress photography portfolio. but it even redraws on lite pages, like contact, which only has css bacground images. and some text.
http://stackoverflow.com/questions/2182208/css-javascript-caching-properly-wanting-to-prevent-global-page-elements-from-r

this is an interesting troubleshooting method i was considering trying. remove basically all the crap and see what happens then.
"IS my footprint as low as I think it is?"
And so I started removing my external files, one by one. Actually, chunk by chunk. I removed my CSS files, no change. I removed my JS files, change.
So I added my library files back in (MooTools) and the 'persisting' maintained. I added back in some of my plugin files (squeezebox, etc.) and still things looked good.
Then I added sifr back in. This was apparently the culprit.
Circumstantially, ALA and Jessicahische do not use this flash-text replacement library. It makes sense, too: sifr adds

caches
tool to check cache headers

a tutorial on caching

idea- use the ?versionnumber when updating the css or js, but cache it aggressivly.

more tips
1/ clean the css this is new. http://www.cleancss.com/

2/height and width on images - (need to try and alter gallery to do this.

3/ use the trailing slash on links. apparently faster. eg site.com/page/ is better than site.com/page

4/ set appropriate expires http header... gotta find out what this is...

http headers why?? and what?? from: http://www.mnot.net/cache_docs/
Expires headers are especially good for making static images (like navigation bars and buttons) cacheable. Because they don’t change much, you can set extremely long expiry time on them, making your site appear much more responsive to your users. They’re also useful for controlling caching of a page that is regularly changed. For instance, if you update a news page once a day at 6am, you can set the representation to expire at that time, so caches will know when to get a fresh copy, without users having to hit ‘reload’.

This is a really good overview of everything caching, and code examples. great 101. this thing checks the http header for you

general -list not found elsewhere

the ultimate wordpress optimisation guide... and yes its pretty good
nice htaccess example.

using compression
and even better htaccess examples, for different file types.. why seconds and not a year though i wonder...
mentions disabling etags. maybe safari is doing etagging stuff randomly...
i wonder if some of this is all done by wp super cache. really should look into getting the permission right to enable it...

definitive source for cache header examples and other apache speed articles
dont quite get the difference here

this would be a good book to read and 14 basic rules.
its funny how the number
1 is reduce http requests - better get rid of all those different stylesheets for launching...
2 is use a cdn (content delivery network.) what's funny is that the CDN is visibly twice as slow as without a CDN!!! yes, ill admit, im in Australia... but ouch, im not forking out for one of those! twice as slow!
3 is add an expires header, what im working on...

this smart optimiser script sounds pretty cool... it will optimise and add together your css and js and stuff ready to go or something. but CPU overhead is higher.

Design features and options for not using images:
and use of new css properties rather than images... , BUT using those ms filter things.
actually a cool way is listed to do different colour glossy buttons. ive thought of this before but never done it.

ill put this under speed but heres example code for STOPPING plugins loading on pages unless you need them there. something thats been annoying me, eg for gallery scripts, putting all this crap on other pages unessessarily. its a shame this cant be done using page templates, since theres only one header.php template, but whatevs.

im thinking it will need to be if isnot a child of portfolio... remove the script. because portfolio is all different pages. and im seeing its best to avoid listing if about, contact etc, because that limits the cms. less limiting to target specific page parent. unless client renames it but whatevs.