Use file contents as hash seed for cache #99

wants to merge 1 commit into


None yet
4 participants

Hi. Thanks for wordless, I love it.

I had trouble deploying my site to heroku because the filemtime gets set on all the files during deployment which breaks the asset caching. The obvious fix for this is to generate the cache hash from the asset file contents instead of filepath + filemtime, and it seems like that's how this used to work (see f136277#commitcomment-1011805)

Is there a reason why this is a bad idea?

(Possible related issue: #39)


etienne commented Jul 15, 2012

I haven't tested it, but in principle I agree with this change. Maybe someone can chime in about why Wordless moved away from this solution in the first place?

talbet commented Sep 4, 2012

I have also run into trouble pushing a site to a VPN running PHP but not ruby and having wordless try to recompile. Time stamps are the same between local and server but file paths are different.

Can anyone suggest a way to stop recompiling on a new server? Am also interested in why the move from file hash to file path/timestamp was made.

Using jcartledge's fork for now, which works great.


stefanoverna commented Sep 18, 2012

Sorry for the delay :)

The move was due to the fact that it can be quite slow (and useless) to read all the assets just to generate a hash. Think about a Sass stylesheet with 50 imports, each with a hundred lines.

In production, you shouldn't rely on assets caching to avoid assets compilation: you need to bake/compile them in the public folder, using the awesome gem @etienne created

What do you think about it?

That sounds like it would work - somehow I missed mention of this workflow in the docs. I'll give it a try. Thanks.


stefanoverna commented Sep 19, 2012

Yes, it probably needs to be explained better :) Patch welcome!

STRML added a commit to STRML/wordless that referenced this pull request Sep 19, 2012


stefanoverna commented Sep 19, 2012

Closing this for now :) Thanks everyone for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment