Re: Dynamic images

From: FLEB (soon.the.sp_at_mmers.and.evil.ones.will.bow-down-to.us)
Date: 01/24/04


Date: Sat, 24 Jan 2004 00:42:59 -0500

Regarding this well-known quote, often attributed to CountScubula's famous
"Sat, 24 Jan 2004 01:48:37 GMT" speech:

> "Chung Leong" <chernyshevsky@hotmail.com> wrote in message
> news:iIydnbKaXIqAXIzd4p2dnA@comcast.com...
>> Nice. I think we make better use of the client cache though, by
> redirecting
>> to the generated image. As it is, the browser has to refetch the image
>> everytime.
>
> Thank you,
>
> Hmm, sounds interesting, you mean have a cache dir that is in the web server
> view, and do a Location: bla.... to point to the image?
>
> Hmm I will have to play and see, becouse as it is, if there is any change
> int he source image, there is a new image generated.
>
> also, I just added a few more functions:
>
> title - add a caption
> pan - show part of image
> zoom - show a zoomed from middle portion
> tile - tile the image

Just title the cached image uniquely --

something like:
[PATH-HASH]_[MOD-DATE].ext

where [PATH-HASH] is the full original path, run through something (md5 or
a search-replace) to purge evil chars, and [MOD-DATE] is the file's
last-modified date. When the code is run, do something like:

1.) Get all filenames containing [PATH-HASH] in the cache directory
2.) Is the latest [MOD-DATE] the same as the real file's modified-stamp?

3. Yes) Do not recreate the thumbnail. Redirect to the cached version.

3. No) Delete (unlink) all files with [PATH-HASH]_*
4. No) Create a new thumbnail, and redirect to it.

-- 
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
   (put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com


Relevant Pages

  • Re: NoAccessAllowed.aspx
    ... Set a low cache time in your page to ensure it does not cache for long on ... > the user clicks the BACK browser button after the session has expired? ... How do you know to redirect them? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Cant end session with logout button
    ... some reason it wouldn't do the redirect after hitting the "Back" ... But if the page is in the cache then your script is not being called to ... hitting "back" after they've logged off. ... It should be easy enough to examine their html to find out. ...
    (comp.lang.php)
  • RE: Major Folder Redirection Issues
    ... the offline files cache and database ... You may have to reinitialize the cache. ... "Failed to redirect because the destinaiton ... PROFILES is properly shared as PROFILES$. ...
    (microsoft.public.windows.server.general)
  • Re: Cache VaryByParam problems
    ... It appears that the page I mentioned does a redirect to itself and, ... not the one actually doing the redirection, the workflow engine is ... I'm using Cache VaryByParam on a page and I'm not getting the ... would be retrieved from the cache regardless of the values of the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Pictures wont store in users cache
    ... Then I opened the page and then checked my browser cache files, ... This will open the images in a new browser window and when the user closes the ... I've built a web site and none of the pictures I've put into it are caching and the photo gallery (100+ pictures with auto thumbnail) thumbnail doesn't cache either. ...
    (microsoft.public.frontpage.client)