You are here: Re: For Those On The Cutting Edge Of Web Design « HTML « IT news, forums, messages
Re: For Those On The Cutting Edge Of Web Design

Posted by Richard Cornford on 07/02/05 07:18

Onideus Mad Hatter wrote:
> Richard Cornford wrote:
<snip>
>>I could see from your code that you just don't have a handle
>>on the issue, but thanks from making that obvious.
>>
>>> I suppose maybe I could take blatant stupidity into account
>>> more and use a time stamp on teh file names, but then really
>>> Richie, would you have ANYTHING left to bitch and moan about?
>>
>>I could see from your code that you just don't have a handle
>>on the issue, but thanks from making that doubly obvious.
>
> Uh oh! There ya go runnin at the fuckin mouth again, Richie!
>
> He, he, he...boy I was just WAITIN for you to reply!
>
> Look again, Dimbulb, teh site now uses a date/time stamp on
> every image to ensure a brand spankin new one even if you've
> got yer browser settings set to 'never check for newer versions'.

You realises that every time you change your code you will be admitting
that my original assessment of its inadequacy were justified? And so
also that your pseudo-patronising responses were not.

> Now then, was there anything else you wanna to bitch and
> moan about, Richie dearest? Hrmmm? ^_^

If you have ensured that all HTTP request for images are going to be
served by the server, and the server re-scales the image for each and
every request, you have made the performance of the server the limiting
factor. And as you are asking it to do a great deal to serve each
request. The result will not scale up at all well.

I knew from your comment above that if you jumped you would jump in the
wrong direction. It is the inevitable consequences of you not
understanding what you are dealing with.

In practice you want those intervening HTTP caches (and browser caches
for that matter) to be caching as much as they practically can. Because
that reduces your (heavy in this case) server load and server bandwidth.
What you don't want is to have those caches serving images that have
been scaled to one size when you are expecting another. That is; you
want the caches to see each individual size of image as a distinct
resource, but see request for images of the same size as the same
resource. And you certainly do want them to cache all of the images that
they are willing to.

You achieve that by passing the dimension information on the query
string of a GET request, so a request for "img.php?width=120" is
distinct from a request from "img.php?width=320", and you send HTTP
headers that will encourage the caching of the images. Thus both images
get cached as distinct entities but any subsequent requests for
"img.php?width=320" get served from the cache, but with the correctly
scaled image. Instead of your server flogging its guts out scaling
images all the time, eventually the majority of image requests will be
served instantly by caches without even impacting on your server.

Easy isn't it when you understand how it works? And if you were a
fraction of the expert you claim to be you could have been doing that
from the outset, instead of having to have it laid out on a palate for
you by a "spoon fed educated moron" like me.

(You may now feel patronised, because you have been. Though I doubt your
arrogance will let you).

Richard.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация