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

Cache-Controls headers are not being applied to SVG images in css stylesheets. #163

Open
kevinkurpe opened this issue Apr 2, 2014 · 3 comments

Comments

@kevinkurpe
Copy link

I have successfully implemented sinatra-assetpack in my application with one exception: svg images in my css stylesheets.

Neither cache-control headers nor a cache-busting suffixes are being applied to svg images in my css stylesheets.

e.g.

background: url(/images/map.svg);

I should mention that svgs located in my erb templates load properly.

Any ideas?

@j15e
Copy link
Collaborator

j15e commented May 14, 2014

Which version do you use? SVG support was added a long time ago in v0.0.11 but that might be your problem.

@kevinkurpe
Copy link
Author

I'm using version 0.3.2

@j15e
Copy link
Collaborator

j15e commented May 14, 2014

I have an exemple here with an SVG inside a CSS that works :

http://code.hooktstudios.com/css/application.4b394912e9f486980c222a6dd5071d25.css

You can browse source here : https://github.com/hooktstudios/code

Assets URL in CSS are being replace with cache-busting prefixes in this method, it may give you a hint why it does not work in your case :

https://github.com/rstacruz/sinatra-assetpack/blob/master/lib/sinatra/assetpack/css.rb#L6

Looking quickly at the regexp the ' or " should not be required, but maybe there is a bug, you should try writing url('/images/map.svg'); rather than url(/images/map.svg);

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

No branches or pull requests

2 participants