Support » Plugin: LiteSpeed Cache » Load combined CSS and JS file from Amazon Cloudfront

  • Resolved m1000



    I would like to load combined min/bf584.css and min/8e7cb.js files from Amazon Cloudfront and only this 2 files (I don’t need cdn for images) do you have any tutorial how to do it?

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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 isn’t 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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Load combined CSS and JS file from Amazon Cloudfront’ is closed to new replies.