W3 Total Cache
Minify on a Per Page Basis (5 posts)

  1. danielmichel
    Posted 3 years ago #

    So if I'm to understand correctly, choosing a particular page instead of 'All Templates' just means that if i chose this_file.js on 'Contact' page, it wont be minified on the 'Home' page? It will only be minified on the 'Contact' page? I thought it meant that 'this_file.js' will only be loaded on the 'Contact' page. Even if i do if(is_page('contact)){only enqueue this_file.js} , I cant exclude this_file.js from loading on every other page?


  2. bheadrick
    Posted 3 years ago #

    You would need to do that by finding out where the file is being enqueued - as in what action hook is being used - and conditionally dequeue the script. There's no functionality within w3tc to make certain scripts/styles not load.

  3. danielmichel
    Posted 3 years ago #

    Would be awesome if Minify included an exclude

  4. danielmichel
    Posted 3 years ago #

    Quick question: even if I do conditionally exclude JS from certain pages, that W3 Total Cache is all or nothing, so I would be left with certain pages that have the all the JS combined, and others that dont.

    Is there any way to add something that says if(is_page('contact)){only enqueue this_file.js} <--but add that to the combined JavaScript?

  5. bheadrick
    Posted 3 years ago #

    I think the next release of the plugin might be a little more sophisticated with minification, but I don't know if this specific feature is included.

    I suppose it's possible if you were to dig through the code, you might find a way to do it, but there is no documented easy way to do this.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic