mozilla / connect-cachify

Express connect middleware to provide easy frontend caching for Node.js
Mozilla Public License 2.0
131 stars 21 forks source link

truncate hash to 8 characters #5

Closed ozten closed 12 years ago

ozten commented 12 years ago

Suggested by @mmayo and @lloyd

We should shorten the hash in urls to 8 characters.

Hashes are always scoped to a filename, so we probably don't need an entire hash for uniqueness.

This has some other nice properties - middleware can handle SHA or MD5 hashes, since they are indistinguishable truncated to 8 characters.

vmunix commented 12 years ago

Also food for thought: 10 chars would allow for use of a unix timestamp unaltered. (i.e. the rails default)

ozten commented 12 years ago

Updated docs. Hardcoding to 10 digits. Probably want this to be configurable at some point...

In v0.0.6. v0.0.7 tag coming for another tweak.