WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
FEATURE: move external scripts to before minified scripts (1 post)

  1. helgatheviking
    Member
    Posted 1 year ago #

    I find that scripts that depend on external scripts (usually 3rd party APIs and the such) fail when minified because the minified script is loaded first thing, while the external script is skipped and comes later. So the local scripts don't have the objects/functions that they require and produce errors.

    Yes manual minify mode exists, but I'm thinking that if you could move the external scripts to load prior to the combined, minified script you could still do it all automatically.

    What if any external scripts were moved to a low priorty of wp_enqueue_scripts and the minified script came at a high priority on the same hook? Or what if there was an option to move the minified script to the footer? I don't know how hard this would be, but if it weren't to difficult it would be a big step in making the awesome auto-minify setting work for more people.

    This user suggests a way to move the minifed script to the footer:
    http://www.securefreak.com/moving-w3-total-cache-minify-auto-javascript-to-footer/ via the thread:
    http://wordpress.org/support/topic/plugin-w3-total-cache-combine-only-before-doesnt-work#post-2479779

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags