optimocha / speed-booster-pack

Official Repository for Speed Booster Pack
GNU General Public License v2.0
22 stars 4 forks source link

Options to be able to exclude cache by cookies #42

Closed lukecav closed 3 years ago

lukecav commented 4 years ago

Being able to exclude cookies from being cached for WordPress, WooCommerce and Easy Digitial Downloads plugins would be very useful. Example cookies to exclude

woocommerce_cart_hash
woocommerce_items_in_cart
edd_items_in_cart

https://docs.woocommerce.com/document/woocommerce-cookies/ https://docs.easydigitaldownloads.com/article/2280-wp-fastest-cache

optimocha commented 4 years ago

Not a bad idea @lukecav! We'll definitely look into it and try to include it in one of our future updates.

rosariomarsala commented 3 years ago

Hello,

I have run entire days of testing with the most popular caching plugins such as: WP Fastest Cache; WP-Optimize; W3 Total Cache; Autoptimize; WP Super Cache; Cache Enabler; Hummingbird; LiteSpeed Cache. I can say that this plugin "Speed Booster Pack" is the best for the results obtained in tests of GTmetrix, Pagespeed and other similar tools, but this plugin lacks a fundamental option that unfortunately makes it unusable, the ability to exclude from the cache cookies that are used by plugins for the consent of the cookie banner and gdpr, in my case, I use a plugin that makes you choose different levels of cookie preferences, at each level the cookie "ct-ultimate-gdpr-cookie" changes value, but with the inability to exclude it from the cache is impossible to operate the cookie banner. Is it possible from htaccess file to exclude the cache of declared cookies ?

thanks Rosario.

lahmacun commented 3 years ago

Hi @wwwmage,

Actually we added this feature in the next version (4.2.0). We are planning to release the version soon. @optimocha may provide more detailed information about this feature and issue if you need.

Best regards.

rosariomarsala commented 3 years ago

Thank you, since you already have the solution implemented in the next version 4.2.0, I will wait for the new release, I find this plugin really interesting, I would say the best.

optimocha commented 3 years ago

Thanks for your kind words, @wwwmage! We'd appreciate it a lot if you can install the 4.2.0 branch of this repo as a plugin and test it on your own environment, so we can squash any potential bugs you may find even before releasing it to everyone.

rosariomarsala commented 3 years ago

Yes, I would be happy to test the new release and inform you of the results.

Thanks

optimocha commented 3 years ago

@wwwmage thank you so much! You can download 4.2.0 on this page: https://github.com/optimocha/speed-booster-pack/tree/4.2.0

rosariomarsala commented 3 years ago

I just test the new branch 4.2.0 version.

I found a problem on the caching tab. When I try to enable this tab, it does not save and gives an error, as in the picture. If I try to save the tab with the option disabled, there is no error. From what I can see there is an error on the new part of the cookie exclusion. Waiting your feedback to continue further testing.

Thanks Rosario

error-caching-tab_4 2 0

lahmacun commented 3 years ago

Hi @wwwmage Actually today I was working on this. During the development process I never seen this error but today when I was testing the plugin I faced the issue but haven't solved yet. Currently working on it. If you want to play around this error you may want to check includes/classes/class-sbp-advanced-cache-generator.php

I'm hoping to solve this problem tomorrow morning (UTC+3)

rosariomarsala commented 3 years ago

Sorry, I forgot to provide some info about my version installed: wordpress 5.7; php 7.3

OK, I'll try here this evening too: includes/classes/class-sbp-advanced-cache-generator.php

Thanks

rosariomarsala commented 3 years ago

Hi @lahmacun

it seems to me that the problem is in the file class-sbp-cache.php where the function to exclude cookies "caching_exclude_cookies" is missing:

near line 39 --> private function should_bypass_cache() near line 324 --> public static function create_settings_json( $options = null )

Thanks Rosario.

lahmacun commented 3 years ago

Hi @wwwmage

I just pushed few changes to 4.2.0 branch. You can check it out. It should work now.

rosariomarsala commented 3 years ago

Hi @lahmacun I just tested the last 4.2.0 branch.

now, you can enable the cache tab without errors, but unfortunately the popup and cookie banner blocker doesn't work even if you put the "ct-ultimate-gdpr-cookie" cookie in the exclusion list. Did you run tests with other cookies ?

even if i think that in part something works, because changing tab, the cookie "ct-ultimate-gdpr-cookie" changes value, and the new value is maintained, but there is something running cache that blocks the correct operation, and even if i choose all cookies, when i reopen the tab of cookie choice, i find again the setting at the first level, so not maintain the correct choice level.

Disabling css and assets tab, it still doesn't work, only disabling the cache in the first tab, everything is working again as before.

If you provide me an email, i could send you the zip folder of this gdpr plugin if you want to run a test, or if you want to check in my installation, let me know.

Thanks Rosario

lahmacun commented 3 years ago

Hi @wwwmage

My email address is zhdefe[at]gmail[dot]com. It would be great to run a test.

lahmacun commented 3 years ago

Hi @wwwmage

It's me, again :sweat_smile: I just pushed few changes to 4.2.0 branch and it must be working right now. Could you test it, please?

Thanks, Zahid

rosariomarsala commented 3 years ago

Hi @lahmacun,

now, the gdpr cookie popup, keeps the choice and it works, but there is a problem, as long as i don't accept the cookies, the cache speeds up the site, but as soon as i accept the cookies, the site loses the effectiveness of the cache and thus the speed. for example the TTFB time goes from about 50 msec (before accept cookies) to about 2 sec (after accept cookies). i send in your email address the website url.

thanks Rosario

optimocha commented 3 years ago

@wwwmage if you add the GDPR plugin's cookie to the list, it's only natural I'm afraid. You see, when you add the GDPR cookie to the exclude list, you're basically telling SBP to not show cached indexes if the visitor has accepted cookies.

rosariomarsala commented 3 years ago

Hi @optimocha Yes I think it is correct what you say. But, in this way, you lose all the advantages of cache optimization. These plugins for gdpr cookie, are a real problem, but unfortunately by law you must have it. Need to see if there is a way to have both.

optimocha commented 3 years ago

@wwwmage I'm actually wondering why you're trying to exclude the GDPR plugin's cookie. Is there any conflict between the GDPR plugin and SBP?

rosariomarsala commented 3 years ago

Hi @optimocha

yes the GDPR plugin is in conflict with SBP, this plugin I use in particular has 4 tabs of cookie configuration levels "necessary; functionality; analytics; marketing". If I don't exclude the cookie of this plugin "ct-ultimate-gdpr-cookie", it doesn't keep in memory the level chosen by user, and it doesn't block cookies properly. the value of "ct-ultimate-gdpr-cookie" cookie changes value at every level choice.

optimocha commented 3 years ago

@wwwmage to be completely honest, this looks more like an issue that stems from that plugin instead of SBP. And the plugin documentation accepts issues with other performance plugins: https://gdpr-plugin.readthedocs.io/en/latest/issues/issues.html

However something caught my eye on that page:

For issues where user have set to accept cookies but user still gets notice on every/selected pages, please check your Ultimate GDPR & CCPA version. This issue should be resolve from Ultimate GDPR & CCPA version 1.6.1 onwards.

Is this the same issue you're having with SBP? If so, is your plugin up-to-date (v1.6.1 or newer)?

rosariomarsala commented 3 years ago

Hi @optimocha,

the problem is not the same, the popup does not reappear after choosing and giving ok, this part works.

Regarding the version of this plugin, I installed the last available version 2.3.

I also made a little video showing the problem.

if you have a gmail email address, i could send you the video (18mb), also i could send you the zip folder of this plugin that could be useful for test.

or i can send everything to @lahmacun email ?

thanks.

optimocha commented 3 years ago

@wwwmage you can send it to baris [] optimocha.com.