WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[resolved] browser downloading minified JS CDN files (5 posts)

  1. Nic Windley
    Member
    Posted 3 years ago #

    I have W3TC setup with amazon cloudfront using multiple subdomains / CNAME's for different minified file sets i.e..

    cdn.css.mysite.com - CSS files
    cdn.jshead.mysite.com - JS <header> files
    cdn.jsab.mysite.com - JS after <body> files
    cdn.jsbb.mysite.com - JS before </body> files
    cdn.mysite.com - all other files

    These are all setup in my DNS zone CNAME records to point to my amazons CDN bucket: myid.cloudfront.net

    They have also been added to the distribution settings in cloudfront.

    I find that browsers such as FireFox are trying to download the minified JS files, which are being sent via their relevant subdomains instead of executing them.

    For example, when I load the site in Firefox I get the following downloads popup.

    cdn.jsab.mysite.com/wp-content/w3tc/min/1b036c/default.include-body-nb.3490654809.js.gzip
    cdn.jshead.mysite.com/wp-content/w3tc/min/1b036c/default.include-nb.2483601537.js.gzip

    If I disable browser HTTP compression for Cascading Style Sheets & JavaScript files then I no longer get the problem, but files are no longer served from their respective sub domains or minified.

    Don't think I have this setup quite right. Can somebody point me in the right direction.

    Thanks,

    Nic

  2. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Can you submit a bug submission from the support tab of the plugin?

  3. Nic Windley
    Member
    Posted 3 years ago #

    Frederick,

    Thanks for the reply and think I've found a fix / balance.

    The browser issue was actually a download plugin which was trying to grab the files as it only happens on the machine running this plugin.

    The JS minification issues I've resolved for now by disabling JS minifcation altogether as it does not seem to play nice. I just can't seem to find a combination of files that work together reliably.

    I'm sticking with the CSS minify as the file set I've found seems to work OK.

    With this setup I get the minified CSS files serving from the correct subdomain and everything else from the standard cdn subdomain and the site renders correctly and all plugins work.

    Do you still want me to send a bug report ?

  4. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Yes, that's still an odd issue.

  5. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    No thanks, I will add other JS minifications later in the future to try to overcome some of the bad code that's out there.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic