dogesay
dogesay copied to clipboard
Cache generations
Open to input on how we should do this, but it definitely should be done
reward 3000 dogecoins
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.
I was actually thinking about this https://github.com/isaacs/node-lru-cache - not that it's not worth also considering etags :grin:
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