Activate WPCSPC blocks element on page
-
Hi,
I have a chat module “flyzoo” that disappears when I activate your WPCSPC. What could be wrong ?
I deactivate HTML / CSS / JS optimization, not better…I use WPCSPC + WP Rocket + Autoptimize, and check that there’s no conflict.
If I deactivate WPCSPC, the chat module is back…
Here is the piece of javascript in the source that appears when the module is displayed :
<script type="text/javascript">(function () { window._FlyzooApplicationId="XXXXXXXXXXXXX";var fz = document.createElement("script"); fz.type = "text/javascript"; fz.async = true;fz.src = "//widget.flyzoo.co/scripts/flyzoo.start.js";var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(fz, s)})()</script><script type="text/javascript">var FlyzooApi = FlyzooApi || { };FlyzooApi.UserId = 28;FlyzooApi.UserName = "YYYY";FlyzooApi.Email = "ZZZZZZZZZZZ@gmail.com";FlyzooApi.Signature = "AAAAAAAAAAA";FlyzooApi.AccessRoles = "subscriber";FlyzooApi.Language = "auto";FlyzooApi.Friends = "";FlyzooApi.Avatar = "https:\/\/BBBBBBB.com\/wp-content\/uploads\/2020\/05\/CCCCCCCC.jpg";FlyzooApi.Profile = "";</script><noscript><style>.lazyload{display:none;}</style></noscript><script data-noptimize="1">window.lazySizesConfig=window.lazySizesConfig||{};window.lazySizesConfig.loadMode=1;</script><script async data-noptimize="1" src='https://BBBBBBB.com/wp-content/plugins/autoptimize/classes/external/js/lazysizes.min.js?ao_version=2.7.7'></script>
I always purge all caches before my tests / changes.
Thanks,
regards,
Law
-
Hi @laucoste,
Can you disable WP Rocket and try again? It’s really hard to say what’s happening without looking at your website and browser developer console. Anyways disable WP Rocket and try. Also are you using fallback cache inside WPCSPC?Hi,
meybe there is a page caching conflict or you are seeing an old HTML code. Did you see the javascript code on your HTML? If not, purge the cache, wait 30 seconds and retryI think I have found the breakpoint. I stopped WP Rocket + Autoptimize and deactivate all settings in WPCSPC that I let enabled.
The chat module is back only when I pass… on Worker mode. So currently, if I activate Worker mode, it cancels all the benefits from the plugin (so it’s like if the plugin was not active regarding to the cache effects). As my chat module is central, I cannot remove it.
So, how to deal with the worker ? I’ve read documentation :
– https://medium.com/homullus/fake-and-free-bypass-on-cookie-with-cloudflare-edge-cache-workers-for-wordpress-72c36d23c174
– https://github.com/cloudflare/worker-examples/tree/master/examples/edge-cache-html
It’s a bit technical to me.And found this plugin that you may know :
https://wordpress.org/plugins/cloudflare-page-cache/
=> Is there an interest for me to use it in addition to WPCSPC (I have simple Pro CF subscription). My goal remains to let all pages completely uncached for logged in users.Could you lead me in the configuration about the worker please, in order to make it work with the “enabled” option in WPCSPC ?
Hope my problem can help other people,
Regards,
LawComplement :
Now in Cloudflare dashboard, I see that “swcfpc_worker” is added in “Workers” section.
Some infos about it :
– Your sub-domain : mysite.workers.dev
– Deployed on swcfpc_worker.mysite.workers.dev
– In Parameters : No variable defined for this worker
– Into the code of the worker, I see it starting withconst DEFAULT_BYPASS_COOKIES = [ "wp-", "wordpress_logged_in_", "comment_", "woocommerce_", "wordpressuser_", "wordpresspass_", "wordpress_sec_"
So I guess it’s what I need.
I’ve cleared the cache again and tested but it looks that the worker is not active for the moment.
Thanks for you assistance,
LawHi @laucoste,
I simply don’t understand your question. The Worker mode is an alternative to page rules mode. You can either use the page rule mode or the worker mode. Now, are you looking to overwrite the existing Worker code? If so, that is also possible please check the FAQ tab inside the plugin settings. Check the Advanced Questions inside the FAQ tab.if I activate Worker mode, it cancels all the benefits from the plugin (so it’s like if the plugin was not active regarding to the cache effects).
What? The worker mode doesn’t cancel any benefits of the plugin. You can use this plugin either in worker mode or page rule mode (the default option).
I simply don’t understand what you are trying to do or say here. Sorry! Again if you want to overwrite the default worker code that this plugin provides you can absolutely do so. Check the FAQ tab inside the plugin settings page.
Hi @isaumya
So, let’s tell that I cannot not use the Page Rule mode. Because once activated, it breaks my site (chat module unusable).
Now, I’m focus on Worker mode. In complement on what I detailed in my previous message (“swcfpc_worker” mentionned in Cloudflare > Workers, no variable activated…), what is missing to make the worker work ?
I’m not looking to overwrite anything.
I just need you to show me the remaining steps in order to make the worker fully functional.Thank you for your help,
Regards,
LawHi @laucoste,
In complement on what I detailed in my previous message (“swcfpc_worker” mentionned in Cloudflare > Workers, no variable activated…), what is missing to make the worker work ?
The worker works out of the box. If you enable the worker mode inside the plugin it instantly starts using Cloudflare worker for your website. You don’t need to set variable or anything else. You don’t have to touch anything inside the worker tab inside Cloudflare. Everything is handled by the plugin. You can tinker around with Worker if you want and if you know exactly what you are doing. But generally, you don’t need to do anything.
I’m not looking to overwrite anything.
I just need you to show me the remaining steps in order to make the worker fully functional.As soon as you enable the toggle inside the plugin and enable the Worker mode, that’s it. You update your plugin settings. Enable page caching again as the plugin will ask you to do that again as you have now changed to worker mode. Thats it. You are all set.
Thank you @isaumya for these elements. Glad to know there’s nothing more to change on the CF dashboard.
Now, with the current configuration in WPCSPC, my site is not broken anymore, but a logged in user still has cache (the pages he sees could’nt be cached).
Current settings : The Worker mode is activated, but I disabled all the other options in “Cache” and “Advanced” tabs.
Could you see what setting is missing to get the cache for the logged in users ?
Thank you,
LawHi @laucoste,
What you are saying is simply impossible as when you are using worker mode, for logged in users no page is cached and all are bypassed. Can you open the chrome developer tools, open the network tab, visit the site as a normal loggedin user (no need to be an admin, any loggedin user). Then in the network tab click on the first request at the very top and share the response header that you see.
Example Screenshot: https://i.imgur.com/8B6lp0z.pngHi @isaumya
Ok, so :
After a successful login on the login page on my site, there’s another welcome page, where the response header of the 1st request is :
cache-control: no-cache, must-revalidate, max-age=0 cf-cache-status: DYNAMIC cf-ray: 5cafbfa74f4fee6d-CDG cf-request-id: 04e1b61c8b0000ee6d5490b200000001 content-type: text/html; charset=UTF-8 date: Sun, 30 Aug 2020 16:04:40 GMT expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" expires: Wed, 11 Jan 1984 05:00:00 GMT location: https://mysite.com/welcome-page/ server: cloudflare set-cookie: _RUgxGTXBH=1EzR%5D9hTqD; expires=Mon, 31-Aug-2020 16:04:37 GMT; Max-Age=86400; path=/; secure set-cookie: BOTtd_WwiplY=zSZDa1F0bYpI; expires=Mon, 31-Aug-2020 16:04:37 GMT; Max-Age=86400; path=/; secure set-cookie: ADYViFQfxhcR=CdpT2lFc8%5Bsg; expires=Mon, 31-Aug-2020 16:04:37 GMT; Max-Age=86400; path=/; secure set-cookie: wordpress_test_cookie=WP%20Cookie%20check; path=/; secure set-cookie: cerber_groove=66cd5c00051b54fcf6b3d9838896e29f; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure set-cookie: cerber_groove_x_8CvHETjXQ3R4mDPSOsJ91KVpFdbgL0q=lvxXFEiQ0Wpf56M7n9sBhmaL4rq32Kke; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/; secure set-cookie: wordpress_sec_4801951b03b5049ffc3ffadb66d181d2=user1%7C1598976278%7Cvtf0bHrW1xKrlqiKEHzBCEKXyVK7uOCHx6P1cbZjkzt%7Cd5154f95eab204bd1cb00adf34f6c612af91f4d32fe73fea617f9b4069ae4c69; path=/wp-content/plugins; secure; HttpOnly set-cookie: wordpress_sec_4801951b03b5049ffc3ffadb66d181d2=user1%7C1598976278%7Cvtf0bHrW1xKrlqiKEHzBCEKXyVK7uOCHx6P1cbZjkzt%7Cd5154f95eab204bd1cb00adf34f6c612af91f4d32fe73fea617f9b4069ae4c69; path=/wp-admin; secure; HttpOnly set-cookie: wordpress_logged_in_4801951b03b5049ffc3ffadb66d181d2=user1%7C1598976278%7Cvtf0bHrW1xKrlqiKEHzBCEKXyVK7uOCHx6P1cbZjkzt%7Ce3f68e17c4e3757806a704115add54811c6ff7271e0f0e7f4f556008d6c27a21; path=/; secure; HttpOnly status: 302 vary: Accept-Encoding x-frame-options: SAMEORIGIN x-redirect-by: WordPress x-wp-cf-super-cache-worker-status: bypass
–
Then, on this welcome page I click on a validation button and arrive on 2nd page. Here, the response :
cache-control: s-max-age=604800, s-maxage=604800, max-age=300 cf-cache-status: DYNAMIC cf-ray: 5cafbe64bbeaee6d-CDG cf-request-id: 04e1b552f00000ee6d548b6200000001 content-encoding: br content-type: text/html; charset=UTF-8 date: Sun, 30 Aug 2020 16:03:49 GMT expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" expires: Sat, 28 Nov 2020 16:03:44 GMT link: <https://mysite.com/wp-json/>; rel="https://api.w.org/", <https://mysite.com/>; rel=shortlink server: cloudflare status: 200 vary: Accept-Encoding x-wp-cf-super-cache: cache x-wp-cf-super-cache-active: 1 x-wp-cf-super-cache-cache-control: s-max-age=604800, s-maxage=604800, max-age=300 x-wp-cf-super-cache-worker-status: miss
=> On this second page, it is as if the user was logged out.
Hi @laucoste,
The first page hascf-cache-status: DYNAMIC
andx-wp-cf-super-cache-worker-status: bypass
which means that cloudflare is not providing cached content and instead getting the page directly from the server what it supposed to do for logged in users. Alsocache-control: no-cache, must-revalidate, max-age=0
which is correct for pages that not supposed to be cached.Anyways for second one you have
cf-cache-status: DYNAMIC
butx-wp-cf-super-cache-worker-status: miss
means that’s the first request cloudflare has received for that page that’s why it wasn’t cached in its servers. If you refresh the second page you should see CF cache status as HIT.If you want the second page not to be cached in the plugin settings enter the path of this second page in the do not cache url section under cache tab.
yesOk,
Please find here the response of the 2nd page after a refresh :
HTTP/2 200 OK date: Sun, 30 Aug 2020 16:47:56 GMT content-type: text/html; charset=UTF-8 cf-ray: 5caffefe0e306924-CDG cache-control: no-store, no-cache, must-revalidate, max-age=0 expires: Sun, 30 Aug 2020 16:47:53 GMT link: <https://mysite.com/wp-json/>; rel="https://api.w.org/", <https://mysite.com/>; rel=shortlink set-cookie: _RUgxGTXBH=1EzR%5D9hTqD; expires=Mon, 31-Aug-2020 16:47:50 GMT; Max-Age=86400; path=/; secure vary: Accept-Encoding cf-cache-status: DYNAMIC cf-request-id: 04e1ddb2c9000069244aba0200000001 expect-ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" pragma: no-cache set-cookie: BOTtd_WwiplY=zSZDa1F0bYpI; expires=Mon, 31-Aug-2020 16:47:50 GMT; Max-Age=86400; path=/; secure set-cookie: ADYViFQfxhcR=CdpT2lFc8%5Bsg; expires=Mon, 31-Aug-2020 16:47:50 GMT; Max-Age=86400; path=/; secure set-cookie: cerber_groove=66cd5c00051b54fcf6b3d9838896e29f; expires=Mon, 14-Sep-2020 16:47:51 GMT; Max-Age=1296001; path=/; secure set-cookie: cerber_groove_x_8CvHETjXQ3R4mDPSOsJ91KVpFdbgL0q=lvxXFEiQ0Wpf56M7n9sBhmaL4rq32Kke; expires=Mon, 14-Sep-2020 16:47:51 GMT; Max-Age=1296001; path=/; secure set-cookie: asgarosforum_unique_id=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0; path=/ x-wp-cf-super-cache: no-cache x-wp-cf-super-cache-cache-control: no-store, no-cache, must-revalidate, max-age=0 x-wp-cf-super-cache-worker-status: bypass server: cloudflare content-encoding: br X-Firefox-Spdy: h2
I don’t see “HIT” but the
x-wp-cf-super-cache-worker-status: bypass
seems OK.But… how to correct that problem ? A logged in user needs to see directly (without any refresh) the page without cache.
Thank you,
–
Sorry I did not see your last sentence. Ok, I can make an exception on this page / URL but that’s annoying as it is the homepage. I’d want to let a cache on it (even short). Would you see another solution ?
Regards,
I don’t see a problem here. The page is being served as Bypassed. So not serving from cache. If you checking it while logged in then it is serving not from cache. I really don’t see the problem here. You wanted the page not to be cached when logged in. That’s what’s happening here. Whether the user refresh the page is irrelevant.
Hum… no
Please refer the previous answer :
For a logged in user :
1/ First display of the page : x-wp-cf-super-cache-worker-status: miss => No more uncached = KO
2/ Second display after manual refresh : x-wp-cf-super-cache-worker-status: bypass => uncached = OK
The solution would to have the first display with x-wp-cf-super-cache-worker-status: bypass => A user must see the page as logged in directly.
Do you see what I mean ?
Regards,
- The topic ‘Activate WPCSPC blocks element on page’ is closed to new replies.