Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter bandee2

    (@bandee2)

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

    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…

    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…

    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 4 years, 5 months ago by bandee2.
    • This reply was modified 4 years, 5 months ago by t-p.

    Hello,

    Here’s a code that should work for this without using the plugin:

    <iframe id="ibe" src="https://www.testpage.abc/index.php" style="width: 100%"></iframe>
    
    <script>
    (function() {
    var frameBaseSRC = document.getElementById("ibe").src;
    var frameQueryString = document.location.href.split("IDde=")[1];
     if (frameQueryString != undefined) {
      document.getElementById("ibe").src = frameBaseSRC + "?IDde=" + frameQueryString;
     }
    })();
    </script>
    Thread Starter bandee2

    (@bandee2)

    Never mind, I’ve found a solution, I share it here if somebody would have the same problem:

    <iframe id="myIframe" src="https://player.vimeo.com/video/" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" width="640" height="360" frameborder="0"></iframe>
    
    <script>
    (function() {
    var frameBaseSRC = document.getElementById("myIframe").src;
    var frameQueryString = document.location.href.split("your_parameter=")[1];
     if (frameQueryString != undefined) {
      document.getElementById("myIframe").src = frameBaseSRC + frameQueryString;
     }
    })();
    </script>

    The only thing you need to change in the code is the name of the url parameter “your_parameter”.

    (Anyway, it would be a great feature if this plugin would work with embed codes.)

    Cheers!

    Thread Starter bandee2

    (@bandee2)

    okay, thank you in advance! πŸ™‚

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