Open clavaque opened 9 years ago
It'd also be nice being able to group separate resources to be combined into a new file, separate from the rest that is being combined.
This would, for example, be useful when combining the resources of a certain area of the site, because they aren't required in the rest. Many plugins add resources that get loaded on every page, when only needed in a few, only one, or only an area of the site.
It should be possible to have a unified resource with all the things that are needed in every page, or most, and won't include resources only needed in few places.
Then, even if it need some hacking to achieve it, it'd be possible to deactivate those other resouces on pages that don't need them.
I can do that now, just tried it a moment ago, but then the ZC combined resource changes for those pages, and it's different from the combined resource loaded in other areas, and it needs to be downloaded again.
Being able to have another set of resources combined separately, would only require to download that extra and the one common to the whole site doesn't need to be gotten again.
I hope it's not too confusing... Let me give a simple example:
I have resources A, B, C and D. A and B are needed in every page, but C and D only in a single page. Let's say I manage to disable C and D from every page other than the one where it's used.
ZC would combine AB for the site, but on that page would combine ABCD, so AB gets downloaded again instead of using the cache for it from a previous page.
What I'm suggesting is being able to say that I want C and D in a separate unified resource.
Then when the user reaches that page that needs C and D, he already has AB and only gets the extra CD resource.
@clavaque Thanks for all the suggestions. :-) I'm marking this as an html compressor
enhancement
issue and we'll revisit this during a future development cycle.
:+1:
Piggy backing on this, but would it be possible to put the JS in the footer? If you run Google’s page speed tools, it strongly recommends moving them there. It’s kind of hard to explain to the client that Google isn’t necessarily right in this instance...
@nathanaelphilip writes...
Piggy backing on this, but would it be possible to put the JS in the footer? If you run Google’s page speed tools, it strongly recommends moving them there. It’s kind of hard to explain to the client that Google isn’t necessarily right in this instance...
See Why doesn’t Comet Cache “Eliminate Render Blocking” and move CSS/JS scripts into the footer?
Ah. Ok. I normally have all of my scripts set to go in the footer, but do I need to ensure ALL enqueued scripts go there?
Couldn’t you offer an option that said “load scripts in footer” with the disclaimer about it might break things.
@nathanaelphilip Please see https://github.com/websharks/comet-cache/issues/248 the related discussion there. My mind isn't really made up about whether or not Comet Cache should have an option for that. I tend to agree that having that option, with a big disclaimer, would be sufficient, but this GitHub issue isn't really the place for that discussion. :-) If you leave a comment on #248 I can reopen it for feedback.
ok, thank you @raamdev. i really appreciate the quick responses and this all makes sense.
I see in the HTML Compression settings that one can exclude styles or scripts from it, which is cool for external resources like a script that most visitors will have cached (e.g. from Google servers). I know there's a setting to exclude external resources from the resource combination, but they are all external resources when also using a Static CDN.
It'd be good to distinguish those external resources put by ZC in a CDN and others (i.e. from other web sites). Either as the only behavior, or a settings that lets the site owner pick between both.
I also think that there'd be more flexibility and power for the resources combination, if they also had possible exclusions that apply just to them and not also the code minification.
Maybe it'd be good to give each feature its own panel in the admin page.