Posts

Showing posts with the label images

media cache (with caching)

Image
I supposed the title of my previous post was a little bit misleading. The original (OK version 2) of that code actually didn't cache anything, but just acted as a reverse proxy to resize images. I added some code to perform some rudimentary caching. You can now add cache=1d to have the browser cache the image on the local disk for 1 day. Similarly there are other combinations:. To cache for 1 week add: cache=1w To cache for 2 hours: cache=2h What this means is that after the browser initially loads the image it will hold it on disk and not request it again for the amount of time that was specified. This doesn't apply if the user hits "reload", but works great for normal navigation. Warning This means users won't see a new copy of the image unless they explicitly hit "reload". You may need to use unique urls for changes to images once you start do this. example (cache for 42days and resize to 256x256: <img src="http://mediacache.appspot.com/...

App engine media cache

Image
Ever needed resized images on your site but didn't really want to run batch resize operation? Did you try setting the css settings to resize the image, but realize you where totally hosing your low bandwith users (or generally killing your user experience to begin with). In response to these problems (and the general expense of tools like scene7) I began building a google app engine cloud computing service that will do this and ultimate enable caching. It is essentially an intelligent reverse proxy that will enable image transformation and caching via google app engine. As an example, suppose you want to see the following image on your page But you want it resized to 150px wide One way (the css way) would be to apply style="width:150px" and you would get the following: <img style="width:150px" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDJu46SDigVQUkrf_LtMuFWkm935LJ4SuqHIhwKwtLPy_Z4n5Ey-v_bdRTK7N83LoAlevsAtHAjopQcTt1gSjazArRm2_lK4li...