lscache_wp icon indicating copy to clipboard operation
lscache_wp copied to clipboard

Feature Request: Change delay JS exclude logic

Open mitchellkrogza opened this issue 4 years ago • 2 comments

I've just switched to OpenLitespeed with Litespeed Cache after being on Nginx with FlyingPress. The only thing I can suggest to this great LS Cache is to reverse the logic for delay JS.

Instead of users spending hours trying to find what to exclude from delay , very time consuming and often still doesn't produce satisfactory results, you should rather allow users to specify what IS allowed to be delayed and not the other way around.

This is how FlyingPress works and it's the only cache plugin I've seen that has taken the correct approach. This way you specify what you know can be delayed and everything else is not delayed.

After having used numerous cache plugins I can say this is the best approach I've seen yet and works like a charm.

mitchellkrogza avatar Oct 05 '21 15:10 mitchellkrogza

That would require a new option specifically for delaying, since the current logic works perfectly when deferring instead of delaying.

gerardreches avatar Dec 21 '21 23:12 gerardreches

That would require a new option specifically for delaying, since the current logic works perfectly when deferring instead of delaying.

I do understand that and hope it would be considered as an option. I spent 2 days trying to find what to exckude from delay on my theme Flatsome to no avail and eventually gave up until I have another day to try. I just turned on defer for now and excluded a few important files. I know my way around all cache plugins but have never struggled so much to find all excludes i need like I did with LS Cache. I'll try again over the quiet Christmas period but truly a delay nothing policy and then specifying what you know CAN be delayed is the smartest logic I've seen and FlyingPress is the only one to do it this way around and it work.

mitchellkrogza avatar Dec 22 '21 03:12 mitchellkrogza

Is there any plan to include this feature? I have the same issue right now. Coming from perfmatters where it is also done as described in this thread. This feature would be a game changer in setting this up.

ignacyhologa avatar Jun 23 '23 10:06 ignacyhologa

Will try to add this feature to v5.6.

hi-hai avatar Jun 23 '23 19:06 hi-hai

@mitchellkrogza Just to confirm, the option is used to include JS delay, not JS defer right?

hi-hai avatar Jun 23 '23 19:06 hi-hai

The feature would be about an option to specify js files that would be delayed. I would like to use mostly the deferred option and on top of that specify some scripts that would be delayed. Now the only option is to choose deferred or delayed. It's not possible to use both.

ignacyhologa avatar Jun 23 '23 19:06 ignacyhologa

https://github.com/litespeedtech/lscache_wp/commit/7d6ceffdd2dff477f23fb4368b177252686639dd

hi-hai avatar Jun 30 '23 21:06 hi-hai

@mitchellkrogza @ignacyhologa It has been added in the latest version

5.6 – Aug 15 2023 🌱Page Optimize New JS Delay Includes option. (Mitchell Krog/Gerard Reches/Ignacy Hołoga)

gerardreches avatar Aug 16 '23 18:08 gerardreches