Relative image urls in CSS

May 31, 2012 at 2:47 PM


Great job with this library and thank you for sharing it. 

I have a questions regarding relative image paths in css files. If I add css reference to files placed in a subfolder like:

<xpedite:Resource Url="~/App_Themes/Default/CSS/Global.css" />
<xpedite:Resource Url="~/App_Themes/Default/CSS/Layout.css" />

and in these CSS files  I have rules like:


.inner2 {

then after the files are combined, referenced images are not loaded.

Is there a way to set path for generated CSS link, or maybe these relative image paths could be recalculated and updated by the library? 




May 31, 2012 at 4:03 PM
Edited May 31, 2012 at 4:04 PM

Hi Tom,

Glad you like the library.

You are seeking a feature that I have been meaning to implement for a while now. Currently CSS url's are not re-written and thus relative paths do not play nice with Xpedite at this time (absolute only). I have plans to update Xpedite to support LESS and background sprites and a few other features that I have been meaning to add. Url re-writes will definitely be on that list of features to add; but to be honest is still a little ways out (wrapping up development on some other projects).


Jun 1, 2012 at 3:03 PM

Hi Chris,

Thanks for the answer. I really like your idea of supporting LESS. 

If I may have a suggestion for a killer feature, it would be awesome to have it extensible, so anyone could implement a processor and plug in into a pipeline. One could plug LESS compiler, someone else could plug their own URL resolver for CSS images implementing a plugin's interface  ;).  Or even better - someone could add a custom processor that would set variables in LESS code  that would be then compiled by LESS compiler plugged next in the chain...



Jun 1, 2012 at 4:29 PM

Hi Tom,

Sounds like a great suggestion and should be easy enough to implement. I am just wrapping up development on another project (beta testing stage); but I am planning on circling back to this project after the release for a much needed update. 


Jun 10, 2012 at 4:00 PM

Hi Tom,

Just to let you know, I have started work on the next version of Xpedite. The codebase is being re-built on GitHub ( Once ready for release, I will be publishing a copy of the code on CodePlex along with the official release. 

I expect it will take at least a couple of weeks to get everything put back together, but the new version will have improved MVC, LESS and integration support. Ideally I will improve the sprite support as well, but I might do that in a follow-up release.

Best regards,


Jul 9, 2012 at 12:15 AM

Just an update for anyone who reads this discussion; I am re-evaluating an update of Xpedite.

I have been working with ASP.NET MVC4's bundling features and so far I have been able to make the built in combine/minify do what I need without falling back to the Xpedite library. There is no CSS re-write feature so there may still be an update in Xpedite's future; but before I invest the time on any form of major update I want to identify where Xpedite can add value on top of the included optimization library.