Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added hashed filename to css on deploy, based last modified and file size #23

Closed

Conversation

mattiasottosson
Copy link
Contributor

Based on the problem that happend in #22, a hash is now applied to the main css file upon deploy, which get's linked in to index.html at the same time.

@mattiasottosson
Copy link
Contributor Author

Test page up and running here:
http://emoji-test.s3-website-us-east-1.amazonaws.com/

@joeljunstrom
Copy link
Contributor

We was thinking of this earlier but it would be better if the cache busting were made in a filter of some kind, either in the optimize code or in a separate class.

The Emoji::Optimizer is pretty terrible atm (I wrote it after all) and I'd love to see a rewrite with better encapsulation.
Adding a hash to the sprite name could be done in the same cache busting filter as the css file.

What do you think?

@mattiasottosson
Copy link
Contributor Author

Yup, it would definitely be better if it could be applied in a more generic way to selected files. This was a quick'n dirty one just for the css.

Also felt that some of the code in SimpleS3Deploy should belong to Emoji::Optimizer instead.
Like the minify-method, https://github.com/arvida/emoji-cheat-sheet.com/blob/master/lib/simple_s3_deploy.rb#l65-70

@joeljunstrom
Copy link
Contributor

Indeed, I gave the optimizer a poke but started to cry when I realized we would have to open up the css file again and replace the sprite name after the hashing code and didn't finish it.

I feel that the sprite generator is one sort of optimization, the minifying is another (generic and all), and should be seperate from each other. But both could live in the same Optimization namespace.

The cache busting is another filter in my mind.

@arvida arvida closed this May 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants