BlessCSS / bless

CSS Post-Processor
blesscss.com
MIT License
282 stars 60 forks source link

Option to use input file checksum as cache buster #32

Closed rferri closed 9 years ago

rferri commented 10 years ago

Added option to use an MD5 checksum of the input file content as the cache buster hash. The timestamp will be used by default if the cacheBuster option is not specified as 'checksum'.

Addresses #5

davidwindell commented 9 years ago

Was just looking for this feature as we already use md5 for our cache busting (albeit in the filename...main.md5.css) before needing bless. :+1:

Ping @minlare

aabenoja commented 9 years ago

This probably won't be merged in with @paulyoung focusing on the v4 release.

aabenoja commented 9 years ago

@davidwindell As of the current v4 branch (without any changes that @paulyoung may have sitting privately) does not have cachebusting there is no cachebusting support.

davidwindell commented 9 years ago

Why not? That would make bless unusable for us.

rferri commented 9 years ago

@davidwindell If you include an md5 in the original file name already you should be safe to disable the cachebusting feature when running bless.

aabenoja commented 9 years ago

@davidwindell See #30. tldr; Because a v4 beta is coming soon that does everything more efficiently.

paulyoung commented 9 years ago

I was thinking about deprecating the cache buster feature in v4 since I'm sure there are more robust, dedicated tools for that which can be used in conjunction with bless.

aabenoja commented 9 years ago

I can't remember where you said this, but wasn't one of the goals of v4 to streamline bless so we can pipe the output to other packages? Such as a more efficient cache buster?

EDIT I guess a better way to say this is "make bless a better streaming process"

paulyoung commented 9 years ago

The goal of bless has always been to split a CSS file into the optimal size based on the number of selectors.

Cache buster was something that got added for convenience along the way but it distracts from the purpose of the tool and couples bless to a different problem.

aabenoja commented 9 years ago

I originally meant the changes to v4 specifically, not the goal of the project, though I do agree about keeping the scope of the package small and leave the cache busting to specialized packages.

davidwindell commented 9 years ago

So it seems you are saying we will have to run a script to edit the css file's @import statement just to add cachebusting onto the file's path every time we run bless. That will be a massive pain!

paulyoung commented 9 years ago

@davidwindell - as @rurjur mentioned above:

If you include an md5 in the original file name already you should be safe to disable the cachebusting feature when running bless.

davidwindell commented 9 years ago

We use rewrite rules so we don't have to change the file name, that leaves the import unbusted

yanyu0517 commented 8 years ago

Have you published stable v4 to npm ?

paulyoung commented 8 years ago

@yanyu0517 – I just created #89 to track this.