• Resolved diaphragm0714

    (@diaphragm0714)


    Hello,

    I see this is a great plugin you have made, having read through the support questions i would like to ask, if your plugin supports litespeed cache?

Viewing 15 replies - 1 through 15 (of 24 total)
  • Plugin Author digitalpoint

    (@digitalpoint)

    While I don’t personally use Litespeed Cache, I know others do, and I’ve not heard of any issues running both.

    Is there something specific you are trying to do that isn’t working?

    Thread Starter diaphragm0714

    (@diaphragm0714)

    Hi, thanks for the swift response.

    I am currently using your plugin with Litespeed cache plugin (because Litespeed cache plugin saves different cookies for different countries + currencies).

    I was just wondering if using the image optimization for Webp and Avif in Litespeed cache will have any negative effect?

    Another question i have is in regards to multicurrency plugin such as “CURCY – WooCommerce Multi Currency – Currency Switcher”, if this is compatible? – This plugin uses cookies and also have the ability to select Ajax refresh for compatibility purposes (a few other options such as session, cookies or json). Or is there a way to save this cookies for separate countries + currencies?

    Looking forward to your response.

    Plugin Author digitalpoint

    (@digitalpoint)

    If you are using Guest Page Caching in this plugin, and want to not return the cached version if a user has particular cookies set by Lightspeed Cache or the WooCommerce plugin (and those cookies don’t adhere to WordPress’s normal cookie prefixes), you could manually add them to the WordPress guest page caching Cache Rule here (assuming you already enabled Guest Page Caching): https://dash.cloudflare.com/?to=/:account/:zone/caching/cache-rules

    For example if they are using cookies names that start with wp- or wordpress_, you shouldn’t need to add anything (those cookie prefixes are already covered).

    The only thing I can think of that would cause some sort of issue with third-party WebP or AVIF conversion would be if they were using the same filename after the conversion. While it technically can be done, it would be rather strange if they did it that way. Specifically if you had an image that started as some-file.jpg and then it still was the same name and same file extension after it was turned into a WebP or AVIF, that could be problematic as far as Cloudflare’s edge cache (if it already had it in cache). But that would be an issue with or without this plugin… and honestly I doubt they are retaining the original file name/extension, and if that’s the case, nothing to worry about as far as edge caching.

    Thread Starter diaphragm0714

    (@diaphragm0714)

    Thank you for the detailed answer.

    I am slightly confused on the cookies, for example these are some the cookies “wmc_current_currency, wmc_current_currency_old, wmc_ip_info, wmc_ip_add, wmc_wpml_lang, wmc_currency_rate, wmc_currency_symbol, trp_language

    When the user visits the page the cookie is saved for any user from the same country / currency and cached. I believe the cache version should be returned.

    For the image i disabled litespeed image optimization to use the one in your plugin, but i see 420 error.

    Yes i can confirm when enabling image transform from your plugin images do not load and it shows 420 error from the network tab.

    • This reply was modified 7 months, 2 weeks ago by diaphragm0714.
    Plugin Author digitalpoint

    (@digitalpoint)

    It really depends on what exactly you are trying to do. Are you wanting to *not* serve the edge cached version if those cookie(s) are present and let your origin serve them something different?

    For image transformations, is it HTTP 420 coming from your origin (web server), or does it look more like a Cloudflare error message? If it’s from your origin, maybe you aren’t proxying traffic through Cloudflare (orange Cloud on the DNS entry for your site in Cloudflare)? It only works if traffic is passing through Cloudflare.

    If it’s a Cloudflare error, make sure you have Image Transformations enabled for your zone (domain) here: https://dash.cloudflare.com/?to=/:account/images/delivery-zones

    Thread Starter diaphragm0714

    (@diaphragm0714)

    Thank you for your response. Please see my answer in bold.

    It really depends on what exactly you are trying to do. Are you wanting to *not* serve the edge cached version if those cookie(s) are present and let your origin serve them something different? – I want edge cached versions to be severed for the cookies.

    For image transformations, is it HTTP 420 – I think this is cloudflare either not accessing my origin properly. DNS is correct and set in cloudflare.

    Plugin Author digitalpoint

    (@digitalpoint)

    You can serve different edge cache versions based on cookies, however Cloudflare limits it to Enterprise plans only. Specifically, it’s Custom Cache Keys, and items you can build those keys with varies by plan type (cache keys based on cookies is only available to Cloudflare Enterprise plans): https://developers.cloudflare.com/cache/how-to/cache-keys/#availability

    I can show you how to configure that if you have a Cloudflare Enterprise plan, but that would be needed first.

    Are you able to share a URL you are getting the HTTP 420 at by chance?

    Thread Starter diaphragm0714

    (@diaphragm0714)

    Hello, Thank you for your response.

    Unfortunately i do not have the enterprise plan (Only pro plan)

    I made more checks and i see it works well with Ls cache (I am not sure how on first visit from a country or currency, LScache handles the cookies well and CF does not interfere “This might be because i set the cache page rule in CF as standard” that way it does not specifically interfere).

    I disabled the image transform and all images loaded normally (I disabled it a few hours ago). How do i share a private link to you?

    Plugin Author digitalpoint

    (@digitalpoint)

    Not sure how LScache would be doing it unless it’s not via Cloudflare CDN or they are using unique URLs for the countries (doing it by cookie is definitely an Enterprise-only ability, at least if it’s done with Cloudflare’s network edge cache).

    I don’t think WordPress has the ability to send private messages, but you can send one to me without registering an account by using the contact form here: https://appforcf.com/misc/contact

    Thread Starter diaphragm0714

    (@diaphragm0714)

    Hi, apologies for the late reply.

    Not sure how LScache would be doing it unless it’s not via Cloudflare CDN or they are using unique URLs for the countries (doing it by cookie is definitely an Enterprise-only ability, at least if it’s done with Cloudflare’s network edge cache). – For this i set cache on cloudflare to standard and it works.

    I am not sure if i need the image transform? As my images are always already high and i use CF lossless with webp.

    Bot Fight Mod – Challenge requests that match patterns of known bots, before they access your site… In your plugin, if i turn this option on, will it block good bots? If this is on, i believe there would be no need to use certain security features on CF?

    After the last update, the pluging UI on wp admin backend is broken. The navigation tabs do not work, it just shows a long list of settings

    I sent a link for the image transform error on the link you share.

    Thanks in anticipation of your reply.

    Plugin Author digitalpoint

    (@digitalpoint)

    Do you have a sample URL you could send me that delivers different cached content based on the user’s location? Like I said, I know Cloudflare can and will do it, but they only do it for Enterprise customers, so I’m very curious if someone figure out a way around that account plan limitation.

    Is it possible it’s simply delivering cached content that varies based on the data center location and simply working like Cloudflare edge cache works by default? Cloudflare’s edge cache isn’t necessarily shared between other data centers. Normally that might (mostly) work itself out because cache requests being served from say France would have originally been generated by a user in France (or fairly close). A single cached document can potentially have hundreds of different versions (one for each data center… which typically serves the users that it’s the closest to).

    If you don’t need Image Transformations, there’s certainly no reason to enable it. It would allow you to deliver newer formats like AVIF if your images are stored as WebP, but if WebP is sufficient for you, no reason to change anything. That being said, it looks like your domain/zone doesn’t have Image Transformations enabled. You can check it here: https://dash.cloudflare.com/?to=/:account/images/delivery-zones (it’s a little counterintuitive, but if it says “Enable”… that’s the link to enable it… not that it IS enabled)

    The Bot Fight Mode in the plugin is literally only toggling the settings in your Cloudflare account. Cloudflare explains in a little more details about what it does/doesn’t do over here. It’s no different than toggling it in your Cloudflare dashboard, here.

    I’m not seeing any UI issues on this end when I look at different sites using it. Are you getting any specific error in the browser console when trying to view the Settings page?

    Plugin Author digitalpoint

    (@digitalpoint)

    Re: the Image Transforms thing, I made a change to the next version so the plugin will enable Image Transforms via an API call when needed (when enabling the image transform option). Hopefully that will sort out the situation in the future for others where it didn’t get enabled for the zone.

    Thread Starter diaphragm0714

    (@diaphragm0714)

    Brilliant and amazing. Thank you very much.

    Thread Starter diaphragm0714

    (@diaphragm0714)

    Hello,

    I finally figured out the issue with the images, i tested with another plugin i found on the repo and it worked just fine but i disabled it so i can provide update.

    The issue: The image issue starts when changing country languages or currency the problem happens.

    For example the default website url is abc (dot) com and this works with image ransform but, if a user clicks on the language change then the images are broken. But on the default it website url it works.

    When i tested the other plugin everything works fine.

    Is there any way to look into this to have it working?

    Plugin Author digitalpoint

    (@digitalpoint)

    Does the hostname of the site change if they pick a different language? Like does example.com become en.example.com or something? If you are trying to serve the same image on different hostnames, you would need to whitelist the allowed hostname(s) under the Image Transformation settings for the zone. By default it will only allow transformations on images that originate on your primary domain. You can however pick additional hostnames that Image Transformations are allowed from (you can either call them out individually or use a origin wildcard, like *.yoursite.com).

    Honestly, it’s hard to say what’s going on exactly without being able to see the site in question. I’m just throwing out ideas, but being able to actually *see* it happen would make it a lot easier to help troubleshoot.

Viewing 15 replies - 1 through 15 (of 24 total)

The topic ‘Litespeed cache’ is closed to new replies.