Douglas F Shearer

Improved Image Resizing and Site Move


After much playing around I decided that my image resize script was chewing up too much processor time and memory, thus making page loads a lot longer.

The solution? Cache the thumbnails, and each time the script is called, check to see if an image with those parameters has already been created. If it has, return that image straight from storage, no waiting for it to be re-rendered.

But what happens if the original image is changed, surely the cached thumbnail will be out of date? For this I check that the last-modified date of the thumbnail is greater than that of the original. If not, it renders a new one.

Pretty spiffing. I’ll probably release this script when I’ve cleaned it up a bit

Anyone sharp eyed will have noticed that the URI for this page has changed slightly, I moved my site to the root directory, just felt like it really. I’m getting a lot of things not working because of this, so email any errors you come across to dougal@shearfx.com. Thanks.

Tags

, , , , , .

Related Posts

November 26th 2005 00:19 | comments (0)
 

Comments


There are no comments. Be the first.

Add Your Comments


(Required)

Your email address to get your Gravatar. Address itself is not shown.

(Include the http://)

(Required)

 

You Are Here


Douglas F Shearer

This is the homepage of Douglas F Shearer, a software developer and mountainbike racer. Find out more at the About page.

Gallery Latest


Side on Chips on crown Front on chip2 chip1 img67

Stay Informed


What is RSS?

Top Tags