Click to See Complete Forum and Search --> : Bandwidth saving measures... Do you bother?
bokeh
12-14-2005, 08:57 AM
As the title says, are you bothered about efficient use of bandwidth? Many php sites are static/semi-static... do you check if this is a repeat visit and send a 304? Do you cache your dynamic pages? Do you gzip your output?
I'm interested to here other people's opinions and experiences with efficient use of bandwidth.
winged1
12-14-2005, 09:32 AM
I do pay attention to image size, and on a couple of sites have cropped spaces/comments.
bokeh
12-14-2005, 09:44 AM
I do pay attention to image size, and on a couple of sites have cropped spaces/comments.I'm not really refering to that (unless you are serving images using PHP). More specifically I was refering to php output. In many cases I use php to build stylesheets and javascript as well as HTML, XML and XHTML so I am really talking about those types of use. With HTML pages Apache handles this but with PHP it's up to the script writer and from what I've seen most either don't care or don't know.
SpectreReturns
12-14-2005, 09:04 PM
Personally, I don't pay attention to this stuff (however I do have gzip compression running on my site). I think the 304 idea would work slick however, but seems like a bit of coding to determine the visits (and not very reliable).
bokeh
12-15-2005, 02:28 AM
I do have gzip compression running on my siteSo do I. It's so easy to do, just one line of php, I can't understand why more people don't use it. Where I don't use it though is pages where I want incremental loading. The other problem gzip is programs like mcafee privacy service strip out the accept encoding headerI think the 304 idea would work slick however, but seems like a bit of coding to determine the visits (and not very reliable).I'm experimenting with this at the moment. What I've found is that if you build the page into a variable instead of echoing it out I can then do a hash of the string length and send it as an etag. You still need to either build the page or measure the length of the cached one but you don't send any output on a reload. On some of my pages I have a function at the end called output($content); and this handles sending output to the browser including when appropriate 304 responses.