• I have configured WPFC with StackPath, and as noticed my WooCommerce product lists have images loaded somehow with javascript (Porto theme). I tried to switch it off, but there is no option.
    I have prepared some .htaccess rules (cdn.mysite.com):

    RewriteCond %{HTTP_HOST} !^cdn.mysite.com$ [NC]
    RewriteCond %{REQUEST_URI} ^/wp-content/uploads/(.*\.(jpg|webp|png))$

    And it works nicely, but I don’t like it because actually it is a redirecting to source. Can’t find any other solution at the moment. Any ideas ?
    Maybe I should dig into code hardcode those javascript methods…

    • This topic was modified 4 years, 5 months ago by gwronkowski. Reason: hash removed from code
    • This topic was modified 4 years, 5 months ago by gwronkowski. Reason: gramma
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Emre Vona

    (@emrevona)

    Can you tell me the page url with the WooCommerce product list please?

    Thread Starter gwronkowski

    (@gwronkowski)

    Plugin Author Emre Vona

    (@emrevona)

    but you are not using wp fastest cache. you are using another cache plugin.

    Thread Starter gwronkowski

    (@gwronkowski)

    Bravo, such a smart reply. I am working on few hosts, testing your plugin on localhost currently, on production I have set up W3T, but it causes too many troubles, so I am looking for alternatives. Anyway I just created a dirty hack like this, and it works now for all images sources:

    add_filter( 'wp_get_attachment_image_attributes', 'replace_img_src_with_cdn' );
    function replace_img_src_with_cdn( $attr ) {
        $attr['src'] = str_replace('https://hdrmaps.com/', 'https://cdn.hdrmaps.com/', $attr['src']);
        return $attr;
    }
    • This reply was modified 4 years, 5 months ago by gwronkowski.
    Plugin Author Emre Vona

    (@emrevona)

    you should continue working then…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Js loaded thumbs and CDN’ is closed to new replies.