Load combined CSS and JS file from Amazon Cloudfront




Wordpress LScache Plugin: Load combined CSS and JS file from Amazon Cloudfront

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hello I would like to load combined min/bf584.css and min/8e7cb.js files from Amazon Cloudfront and only this 2 files (I dont need cdn for images) do you have any tutorial how to do it? I integrated it with Cloudfront, files are loaded from Cloudfront but they are not combined. I see it can be resolved adding Included Directories /min/ but there is problem with wrong path to background images. Hi @m1000, can you describe how the path be wrong after loading by CDN? Does the content or the directory has been changed? I use relative path in style.css and other stylesheets, for example background-image: url( img/menu.svg ) when I combine all stylesheets in one file your plugin changes all image pathes to something like this background-image: url( /subdirectory/wp-content/plugins/plugin/img/menu.svg ) and it works fine. But when I try to load stylesheet from Amazon Cloudfront then icon isnt loaded. Generally I would like to keep on on CDN stylesheets and javascripts only, eventually icons too. Hi @m1000, as CSS standard, an absolute path will load the source from the same origin URL of that CSS file. So if your images are not on CDN, that file cannot be loaded. A CSS combine function also needs to rewrite the path as an absolute path because of the combined CSS file directory might be different from the original CSS file. So in this situation, the only solution for your situation is also loading the image from CDN or turn OFF CSS combine function.



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference