WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
W3 Total Cache using wrong protocol during minify for CDN (5 posts)

  1. Patrick Heeney
    Member
    Posted 1 year ago #

    Hello, we are using W3TC with magnification and CDN enabled. The CDN is amazon cloudfront which does not support HTTPS. This problem does not happen all the time but I was just able to reproduce it using safari for some reason.

    Essentially the problem is the cached css file has full path links using https to images. Take this for example:

    .thumb-control.right{left:auto;right:0;background:url(https://cdn8.site.com/wp-content/themes/mt/img/arrow.png) 0 0 no-repeat}

    Since we are on http and cloudfront doesn't work with https this results in broken images. Every image that is used in the CSS file is broken. The only thing I can think of is that somehow the cache file gets saved when the protocol is https thus minifying and converting all assets to https full path links. Then when visiting on http it pulls the cached version which breaks the site. I also am using google mod_pagespeed plugin which may do the actual URL converting if it is not this plugin. Either way, if the css file has to use full path links then 2 css files should be cached one thats loaded on https and the other on http.

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

  2. Patrick Heeney
    Member
    Posted 1 year ago #

    Just another note, the problem stops when minifiy is turned off. Previously using all the default settings. It still appears somehow that it is caching https images within the css files and that file is being displayed to http visitors.

  3. archon810
    Member
    Posted 3 months ago #

    Same problem here. I have no idea why someone thought this would be a good idea to rewrite all images in minified CSS to https like that.

  4. archon810
    Member
    Posted 3 months ago #

    Frederick,

    Here's something you can use to debug this issue. I'm using W3TC 0.9.4 on WordPress 2.8.2 btw. Loading images via SSL doesn't work with our setup, so the site ends up looking broken.

    The CSS file: http://cdn.androidpolice.com/wp-content/themes/ap1/style.css. As you can see, it contains many images with relative paths. For example:

    #header {
      background: transparent url(images/header_bg_1px.png) repeat scroll 0 0;
      height: 124px;
    }

    Now, in http://www.androidpolice.com/wp-content/plugins/w3-total-cache/pub/minify.php?file=hY_dDoMgDIVfyA692vPwU5WkAqE1zrdfxcVki8kugEPP-QrtjS2DoejY-Dkzpu-j65tfkVE-mmUn7AbV4MiywFjzAjIjFL0Zz3xYHAM6W__mbqyTqegxCZTMwrDFMOHF3FjK-JzEeu2V6wJPE5OnNSA3qP2ZNTTa5HeXX0cKtlxD0dH4Kl9Co1vRF4jYtB20jRbFOsKTOfoGHO1K8lhiOgne0xynmXSJ0YEWvEK_NtY3.css, which I've mirrored here https://gist.github.com/anonymous/51e5bc6dc692f62e89e9 in case it goes away, all these images are rewritten with full paths and https for no reason.

    The page I'm accessing is http://www.androidpolice.com without https.

    This bug goes back over a year - can you help push out the fix once and for all? This is the last thing preventing me from using Minify CSS in W3.

  5. archon810
    Member
    Posted 3 months ago #

    Here's another unsolved support topic about the same thing http://wordpress.org/support/topic/minify-adding-https-to-urls-in-css?replies=4.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic