• Resolved bandee2

    (@bandee2)


    Hi,

    Thanks for the plugin, it really speeds up my site. However, I have a few questions:

    1. I use the page builder of Thrive Themes, and when your plugin is installed, it puts a second trigger for buttons that are meant to open a popup window (and puts the swcfpc parameter after links) like this:
    https://ibb.co/C5YvnXW
    So it’s not recommended to save it like this.
    Is it possible to turn this behavior off for pages that have “tve=true” parameter in the URL? (editing mode)

    2. I don’t really understand the use of the swcfpc parameter. Can’t just the plugin say to Cloudflare that “A logged-in user made the request, don’t cache this page”?
    Also, why can’t be a page that are seen by a logged-in user cached, if it only caches the static assets (css, js, images, etc.), not the whole html code? (at least that’s what I think)

    3. I’m trying to use as few plugins as I need to, and I made a few speed tests with and without using W3 Total Cache (with page cache turned off). The results were almost the same. Is there any significant benefit in using W3 Total Cache in addition to your plugin?
    Also, I noticed that when W3 Total Cache is in use and I click on the “Test Cache” button in your plugin, it gives an error saying “Page caching is working for static page but seems not working for dynamic pages.”

    Thanks in advance for explaining these things,
    Andras

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    first of all the swcfpc parameter is added to the URL only for the loggedin users to make sure loggedin users don’t see cached pages. That being said, if you don’t want the extra query parameter to be used, please turn on the worker mode which will use Cloudflare worker and the query parameter is no longer needed. Unfortunately if you use the default page rule mode there is no other way than using the query parameter.

    Now coming to W3TC, I will highly recommend you to delete that plugin. Please note that you are not supposed to use more than one page caching plugin on a site. So, as this is a page caching plugin please remove your other page caching systems from your site. You can use other plugins for static files optimization but not for page caching.

    Thread Starter bandee2

    (@bandee2)

    Thanks for the quick reply!

    If I enable the Worker mode, the site performs 20% worse in GTmetrix (around 70%)…
    test 1 vs. test 2
    Can you please check it?
    [link]

    Also, I’ve noticed an issue with the cookie consent: the site doesn’t care about the cookie that is placed after allowing or denying the consent on some pages like the main page [link], and it asks again for consent upon page refreshing, even if I add the cookie name in the “Bypass cache for the following cookies” section, or if I disable the Worker mode. It only works properly when your plugin is turned off. What is causing this?

    • This reply was modified 3 years, 3 months ago by bandee2.
    • This reply was modified 3 years, 3 months ago by t-p.
    Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    first of all on the second gtmetrix test that you have shared there the LCP is higher so you need to check in Google Page Speed Insight that what is causing the higher LCP and how to optimize it. This plugin does not do anything but page caching.

    Check the cache-control header of your static files, maybe they have some header value which is not letting them being properly cached.

    Now coming to the cookie consent, if your pages depends on cookie values, they should never ever be cached. In fact, if the initial response header of a page has any se-cookie headers Cloudflare won’t cache the page thinking the cookie value might be needed for generating the page content dynamically.

    If you are making a site that is following all proper caching guidelines and making sure that pages can be properly cached. You should need to stop relying on cookies to store data and instead can use javascript to store the data in localStorage. In this way you have the data and the page is also fully cache complient.

    Thread Starter bandee2

    (@bandee2)

    Hi,

    Thanks for your reply.

    Check the cache-control header of your static files, maybe they have some header value which is not letting them being properly cached.

    They are cached, either the page, but it still gets 20% worse result with Worker mode enabled. I don’t understand why. GTmetrix lists the same uncached files in both tests in the “Use a Content Delivery Network (CDN)” section (only some emoticons).

    if your pages depends on cookie values, they should never ever be cached

    I insert tracking codes by PHP based on the existence of the “cookie consent” cookie, as there’s no point in inserting them if the visitor denied the consent. This cookie is not set by set-cookie header, but by Javascript after consenting.
    I just want to bypass caching (and avoid showing cached page) to visitors who has the cookie consent cookie. But why not show a faster cached page for first-time visitors. As I guess, that’s why there is a “Bypass cache for the following cookies” option in your plugin for Worker mode.

    It behaves a strange way, I made a screen recording about it:
    [link]
    So the cache status should be “bypass” if the cookie exists, but as you can see, the main page request remains “hit” after setting the cookie (even after pressing Shift+F5). When I open another page it works properly and sets the header to bypass cache. If I make the consent on another page, that page doesn’t bypass the cache after reloading, but this time the main page bypass the cache. It seems it doesn’t work only on the page where the consent was made…

    Plugin Contributor iSaumya

    (@isaumya)

    They are cached, either the page, but it still gets 20% worse result with Worker mode enabled. I don’t understand why. GTmetrix lists the same uncached files in both tests in the “Use a Content Delivery Network (CDN)” section (only some emoticons).

    – I have no idea maybe test inconsistency or something. Hard to say. I would suggest using webpagetest.org as they have some of the most sophisticated and accurate tools.

    This cookie is not set by set-cookie header, but by Javascript after consenting.

    – If the cookie is not set by PHP set-cookie header then the page should be cached by Cloudflare. Beside if you are using JS to check, again I would highly suggest using localStorage as cookies are not cache friendly.

    I just want to bypass caching (and avoid showing cached page) to visitors who has the cookie consent cookie

    – Please note that as the cookie is not part fo the main response header neither cloudflare nor the system has any idea that the page contains cookie so, they can’t take an action about that. If you want cookie based rejections you have to make sure that the cookies are set by PHP by adding the set-cookie response header so that CF can see that a cookie is present in the request and not to cache it.

    As I guess, that’s why there is a “Bypass cache for the following cookies” option in your plugin for Worker mode.

    – Yes, but just like any system the worker can look at the response header and set-cookie directive but if there is no such thing then how will it see it? The worker is not scanning your whole computer for cookies. It is simply looking at the responses and then taking decision on the fly about what to do.

    It behaves a strange way, I made a screen recording about it:

    – Again this is because the cookie details is not part of the response header. When you are adding manipulating cookies via JS, you really can’t expect the caching system to work smoothly as it is confused most of the time as the JS is being executed on the client-side after the server has sent its response.

    Thread Starter bandee2

    (@bandee2)

    the worker can look at the response header and set-cookie directive but if there is no such thing then how will it see it?

    Isn’t everything start with the request headers?
    It has a cookie directive that contains all the cookies set on the user’s computer. In other way, how your plugin could say in the response header that “User provided excluded cookies present in request” on other pages…

    Anyway, everything works as expected with this method and I get 97% performance result with it:
    https://www.krome.sg/blog/wordpress-plugin-and-cloudflare-worker-quick-guide/
    So I guess there is something in your worker script that creates these issues…

    Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    I don’t see cookieconsent_status in your request header.

    Thread Starter bandee2

    (@bandee2)

    It’s there after accepting or denying the cookies and refreshing the page…

    Plugin Contributor iSaumya

    (@isaumya)

    Hi,
    I just looked at the worker code, the worker is looking at the Request cookie header for the custom cookie names provided by the user.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Plugin creates additional links for buttons in page builder’ is closed to new replies.