dogesay icon indicating copy to clipboard operation
dogesay copied to clipboard

Cache generations

Open jescalan opened this issue 11 years ago • 4 comments

Open to input on how we should do this, but it definitely should be done

jescalan avatar Dec 15 '13 00:12 jescalan

reward 3000 dogecoins

samccone avatar Dec 15 '13 00:12 samccone

I was just reading around; have you guys considered etagify for this?

https://hacks.mozilla.org/2013/02/fantastic-front-end-performance-in-node-part-2-a-node-js-holiday-season-part-6/

The obvious disadvantage I can think of is that if you accept my resizing pull request, there will be multiple urls that produce the same result (e.g. '?size=500' == '?size=500x500'). Then again, I suppose the same is true of just adding a random cache-buster to the query...

Obvious option is, I guess, just saving the images with a name based on the doge phrase/calculated dimensions, but that raises a bunch of issues regarding maintenance of the number of files and doesn't seem to follow the lazier == better principle.

nathanharper avatar Dec 18 '13 22:12 nathanharper

I was actually thinking about this https://github.com/isaacs/node-lru-cache - not that it's not worth also considering etags :grin:

jescalan avatar Dec 18 '13 22:12 jescalan

Yeah, I see now that's already installed with jade, so looks like a good call. I did a simple setup in a branch here:

https://github.com/nathanharper/dogesay/blob/caching/presentors/doge.coffee

nathanharper avatar Dec 19 '13 17:12 nathanharper