WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: W3 Total Cache] CSS Background images from Amazon S3 (11 posts)

  1. sareiodata
    Member
    Posted 4 years ago #

    Hi,

    I finally uploaded the entire media gallery to Amazon S3 and I was wondering how can I load the background images used in the CSS from S3.

    The theme images have been uploaded to S3 with the rest of the theme, but the minimified css links to absolute images on my own server.

    So is this something that's not implemented? I mean using the css background images from S3, or am I just missing something?

    site link: http://www.cozmoslabs.com

    Thank you!
    Cristian

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Posted 4 years ago #

    I'll check if this is a known bug, but for now you can simply remove the http://domain.com/ from your CSS file, leaving a path that starts with /wp-content/ and you'll be all set (after rebuilding your minify cache).

  3. Frederick Townes
    Member
    Posted 4 years ago #

    Can you use the bug submission form in the support tab to send the original CSS file also?

  4. sareiodata
    Member
    Posted 4 years ago #

    Sorry to take so long to answer. It's been a long week...

    Here is my original CSS (don't think I need to use the submission form unless it helps you in some way):

    http://www.cozmoslabs.com/wp-content/themes/cozmic/style.css

    As you can see all the background:url(images/my_image.jpg) declarations are relative to the css file.

    Just as a sidenote the @import's at the top are also relative to the directory where this file resides and are loaded from the parent theme (since I'm using a parent theme <-> child theme relationship). If possible in the future all @import declarations in the main css file should be included directly by W3TC if possible. Those imports add each another http request.

  5. Frederick Townes
    Member
    Posted 4 years ago #

    Here is my original CSS (don't think I need to use the submission form unless it helps you in some way)

    I wouldn't ask if it didn't help. Your current settings and the minify error log etc are included with the submission to facilitate proper support.

    Just as a sidenote the @import's at the top are also relative to the directory where this file resides and are loaded from the parent theme (since I'm using a parent theme <-> child theme relationship). If possible in the future all @import declarations in the main css file should be included directly by W3TC if possible.

    This is a limitation of the minify library and a known issue. Other minification engines will be added later, hopefully addressing the issue, meanwhile it doesn't appear like the minify team is very active with the project, which has made it difficult to move on with the W3TC project as a whole.

  6. sareiodata
    Member
    Posted 4 years ago #

    I wouldn't ask if it didn't help. Your current settings and the minify error log etc are included with the submission to facilitate proper support.

    That makes sense. I've sent a bug report from the backend!

    Thank you.

  7. Frederick Townes
    Member
    Posted 4 years ago #

    http://www.cozmoslabs.com/wp-content/themes/cozmic/style.css should be specified as: wp-content/themes/cozmic/style.css

    Unless a file has a query string variables, the path should be relative.

  8. remotay
    Member
    Posted 4 years ago #

    What I did was simply ctrl F my css files and replaced my domain with the CDN url which essentially fixes this problem.

    Notepad++ can easily find / replace.

  9. Frederick Townes
    Member
    Posted 4 years ago #

    If you use relative paths as appropriate this step is not necessary.

  10. sareiodata
    Member
    Posted 4 years ago #

    Yup. That did the trick. I knew I was missing something.

    Thank you so much for your support.

  11. Frederick Townes
    Member
    Posted 4 years ago #

    You're welcome.

Topic Closed

This topic has been closed to new replies.

About this Topic