I need some advice on creating a thumbnail cache for amazon s3. I need to create a thumbnail for each file fetched from s3. What is the best approach the compare files from s3 with my thumbnails on disk? My current idea is, if I browse one amazon s3 directory in my application i would create that directory on the server and download each file and create a thumbnail using the etag or the hash code. Anyone with a better solution?
Share
Here is what I do:
Say there is a file on S3 at
my-bucket.s3.amazonaws.com/path/to/file.png
It will have an etag associated with it.
I store the thumbnail in something like
my-bucket.s3.amazonaws.com/thumbs/path/to/file.png/”78skfghsfsfkgjh”small.png
I could store the thumbnail under the image, as S3 is a multi forked file system, but I like to keep the real and the generated data separate, for easy dumping/rebuilding.
Then if the main file changes, I can tell as the etag will have changed, and i make a new thumb.
Generating a thumbnail can be tricky for arbitrary file types, (what about that 3GB video). There are some small companies who do it for a fee, i think.
See https://client.spotdocuments.com and click on test drive to see my thumbnails….