aslansky / css-sprite

css sprite generator
MIT License
734 stars 55 forks source link

Added support for an automatic cache buster suffix on the bg image #56

Closed michaelmoussa closed 9 years ago

michaelmoussa commented 9 years ago

Folks who use a CDN can append their own cache buster to the .css file, but the background-image entry in the CSS file would still end up being loaded from the browser cache.

This change adds support for a --cachebuster=random parameter, which will append ?<hash> to the background-image: url(...), where <hash> is a randomly generated 40-character hexadecimal string. This would force the new, possibly updated sprite file to be downloaded freshly.

coveralls commented 9 years ago

Coverage Status

Coverage increased (+0.07%) to 96.99% when pulling 95842dfa09b662b4372ef15dbd353330670616e7 on michaelmoussa:cache-busting into 00f2db80e19fa881c35e2d8075f7a62be1f7570f on aslansky:master.

michaelmoussa commented 9 years ago

Thanks! :)