Jammit does not append a query string to files in production environments after compiling all the assets.

This presents caching problems for me since my web server uses query strings to bust the cache.

How can I use jammit (or another tool) to properly uglify, concatenate, and append a query string?

有帮助吗?

解决方案

Adding a response in case anyone else runs into this.

Jammit rewrites relative urls when concatenating css files. This is necessary because relative paths in css are relative to the file containing the path, so when css files are concatenated, these paths need to be rewritten. During this rewriting process Jammit seems to remove query params. To my understanding, to work around this you'll need to either 1) use absolute urls in your css files 2) patch Jammit.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top