• Hey

    I got a nice query string visibility control going on. Works great — until I enable LiteSpeed Cache.

    So, with cache enabled, any previous loaded state of the page is shown, whether I add or remove a query string.

    That does, when you think of it, make some sense. After all, the HTML document generated, is being cached and reused on the client.

    If I purge my cache via the WordPress dashboard, any visibility changes on the front end are reflecting the query string fine.

    Is that an issue you have encountered before? And do you have any advice? Should I hook into something, disable caching on parts of the page?

    Please let me know if you need me to describe the issue better. I’d love to utilize both Block Visibility and caching. 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Nick Diego

    (@ndiego)

    Hi @oldrup,

    By the dynamic nature of Block Visibility, the content that you want to conditionally show/hide cannot be cached. I have not used LiteSpeed Cache myself, but most caching plugins allow you to exclude certain pages or by Query string. I did a quick look through the LiteSpeed Cache docs and it looks like this is possible here.

    Let me know if I can answer any additional questions.

    Best,
    Nick

    Thread Starter Bjarne Oldrup

    (@oldrup)

    In this case, I was looking for the right solution for the wrong problem.

    The front page definitely should be cached.

    The goal was to hide a few irrelevant buttons in the hero section, when the front page is loaded in a PWA session. Another, and probably more efficient way, would be to create an alternative front page without these buttons, specifically for PWA users.

    As for the remaining sections on the front pages, I can utilize the now more approachable “synced patterns” for easy maintainability.

    That Block Visibility works on the server level, not via CSS, is absolutely preferable, even though it means that it might not be the best solution for this particular use case.

    Thank you, again, for creating and sharing this fine plugin with the community.

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

The topic ‘Issue with Query String visibility and LiteSpeed Cache’ is closed to new replies.