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.

 

Comments


There are no comments.

Add Your Comments


Commenting is closed for this entry.

 

You Are Here


Douglas F Shearer

This is the homepage of Douglas F Shearer, a software developer and mountainbike racer. More…

Hire Me!


I'm available for hire. Ruby, Java and PHP work, both remotely (Worldwide) and locally (Scotland). Find out more or email me.

Flickr Latest


Stay Informed


What is RSS?

Categories


  1. Bike (93)
  2. Coding (85)
  3. Other (46)

Top Tags