Title: Dual layer
Last modified: May 26, 2018

---

# Dual layer

 *  [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/dual-layer/)
 * Since you already make ‘snippet_’ is there a way to add 2 layers of exclude?
 * Instead of making 1.css per page you would end up with 2 per page
 * Eg:
    Exclude scripts from 1 Autoptimize -> make 1a.css, all excluded is pushed
   to layer 2 Further Exclude scripts from 2 Autoptimize -> make 2a.css, the rest
   is just excluded
 * The effect is some pages call 1a.css, some call 1a.css and 2a.css

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/dual-layer/#post-10325996)
 * Maybe the problem is I’m not *really* awake yet, but I’m afraid I don’t understand
   [@funsail](https://wordpress.org/support/users/funsail/). Could you explain again,
   but with a real example and also why you think this could help? 🙂
 *  Thread Starter [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/dual-layer/#post-10326791)
 * The current setup allows code to be Opt into one file or not at all.
 * It’s more likely that you will get groups of pages that have common uses for 
   different features.
 * So rather than having those pages have the one large aggregator file Plus 20 
   excluded files.
 * you could have maybe 3 or 4 chunks of files. each page might use two or three
   of these Chunks.
 * Some pages may only use one chunk.
 *  Thread Starter [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/dual-layer/#post-10326807)
 * so say you would have one file that contains all the base code for the whole 
   site
 *  then you might have a couple of pages that use a table and a flip box. Instead
   of just excluding those files and leaving them, you would actually aggregate 
   them into a separate file.
 *  every single feature tends to have more than a couple CSS and JS files. I need
   to exclude them means you still end up with 20 or 30 files
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/dual-layer/#post-10327611)
 * ok, think I understand more or less, but afraid this would become _very_ complex,
   both code-wise and from a configuration point of view.
 * what seems to be the best way forward to me, would be to use the (currently API-
   only, not GUI) whitelist feature for the base code (which is used on (almost)
   the entire site and let the rest be minified but not aggregated (available in
   AO 2.4 beta already).
 * given the fact that most site are on HTTP/2 (or should be) and thus the HTTP-
   connection is used for multiplexing all requests, this seems the best approach
   really 🙂
 *  Thread Starter [funsail](https://wordpress.org/support/users/funsail/)
 * (@funsail)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/dual-layer/#post-10328731)
 * Exactly. It is hard for you to work out what is common.
    That’s why you have 
   2 fields and we deal with it. For you it’s like running the plugin once, then
   with the leftovers running it again with the 2nd field.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Dual layer’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [funsail](https://wordpress.org/support/users/funsail/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/dual-layer/#post-10328731)
 * Status: not resolved