Title: Content blocked when using LiteSpeed Cache
Last modified: September 20, 2024

---

# Content blocked when using LiteSpeed Cache

 *  Resolved [holomorphic](https://wordpress.org/support/users/holomorphic/)
 * (@holomorphic)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/)
 * Hi! We have a problem with some content on cached pages not showing up. We’ve
   specified that “cookies_and_content_security_policy” shouldn’t be cached in the
   LiteSpeed Cache Settings, but right now a petition on the front page, and videos
   on other pages, are blocked for users who are not logged in (as those visitors
   are served a cached page). Do you have any suggestion about how to fix it, or
   any debugging tips?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcontent-blocked-when-using-litespeed-cache%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/)
 * (@jonkastonka)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18030452)
 * I see the problem too. If I just add a random querystring to the domain I can
   bypass the cache and thereby se that those things are loaded.
 * And if you have added cookies_and_content_security_policy to LiteSpeed Cache 
   as a cookie that should not be cached you should be fine.
 * Can you verify that everything works as it should if you (temporarily) disable
   LiteSpeed Cache?
    -  This reply was modified 1 year, 8 months ago by [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/).
      Reason: Spelling
 *  Thread Starter [holomorphic](https://wordpress.org/support/users/holomorphic/)
 * (@holomorphic)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18030530)
 * Everything works without the cache. I’ve also confirmed that if I manually add
   a specific URI to LiteSpeed’s exclusion list, then the content on that page is
   loaded (but it would be inconvenient to do that for every page with videos, etc).
 *  Plugin Author [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/)
 * (@jonkastonka)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18031053)
 * Very strange .. Can you send a screenshot of the cookies_and_content_security_policy
   cache exclusion?
 *  Thread Starter [holomorphic](https://wordpress.org/support/users/holomorphic/)
 * (@holomorphic)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18031150)
 * I assume you mean the cookie exclusion? Here it its:
 * ![](https://i0.wp.com/i.imgur.com/cdLw5x7.png?ssl=1)
 *  Plugin Author [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/)
 * (@jonkastonka)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18031173)
 * Yes, that’s what I mean.
 * And, can you see something about cookies_and_content_security_policy in your .
   htaccess file?
 *  Thread Starter [holomorphic](https://wordpress.org/support/users/holomorphic/)
 * (@holomorphic)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18031197)
 * ### marker NOCACHE COOKIES start ###
   RewriteCond %{HTTP_COOKIE} cookies_and_content_security_policyRewriteRule.*–[
   E=Cache-Control:no-cache]### marker NOCACHE COOKIES end ###
 *  Plugin Author [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/)
 * (@jonkastonka)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18031494)
 * Looks right to me. Strange.
 *  [brun3o](https://wordpress.org/support/users/brun3o/)
 * (@brun3o)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18124536)
 * Hello!
 * I’ve had this exact problem. For reference, here’s a thread I posted last year:
   [https://wordpress.org/support/topic/refused-to-load-spotify-embed/](https://wordpress.org/support/topic/refused-to-load-spotify-embed/).
   Back then, I thought only my Spotify embeds were affected, but later I realized
   that all embeds were blocked as soon as the page was cached. I also thought many
   times that I’d solved the issue, just to visit my site a day later and find that
   embeds were blocked again. In the end, I resorted to disabling LiteSpeed Cache
   altogether.
 * Now I’ve revisited the issue, and I might finally have the solution. In the CCSP
   FAQ, it says that “cookies_and_content_security_policy” should bee added under
   LiteSpeed Cache > Cache > Excludes > Do Not Cache Cookies. But this seems to 
   be wrong. This tells LiteSpeed Cache not to cache _any_ page where a cookie in
   this list appears in the request headers. Thus, on their fist visit, visitors
   receive a cached page with default CSP headers (no consent), so embeds don’t 
   load. After giving consent the cookie is set, and caching is bypassed for this
   visitor. However, the page they initially loaded is still in their browser cache
   with restrictive CSP headers, and the embeds are still not loading.
 * Instead, “cookies_and_content_security_policy” should bee added to Cache > Advanced
   > Vary Cookies. Then, after giving consent, the cookie is set, and the visitor
   now receives the cached version for users who have given consent. This version
   includes CSP headers that allow embeds from domains specified in Settings > Cookies
   and Content Security Policy > Domains.
 * Hope this helps! I’ve only recently tried this, so I’ll keep you posted if anything
   arises.
 *  Thread Starter [holomorphic](https://wordpress.org/support/users/holomorphic/)
 * (@holomorphic)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18126332)
 * [brun3o](https://wordpress.org/support/users/brun3o/): I tried your solution,
   and it looks like it worked! I think the FAQ should be updated.
 *  Plugin Author [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/)
 * (@jonkastonka)
 * [1 year, 6 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18126715)
 * Thanks! Will update the FAQ.

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

The topic ‘Content blocked when using LiteSpeed Cache’ is closed to new replies.

 * ![](https://ps.w.org/cookies-and-content-security-policy/assets/icon-256x256.
   png?rev=2414719)
 * [Cookies and Content Security Policy](https://wordpress.org/plugins/cookies-and-content-security-policy/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cookies-and-content-security-policy/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cookies-and-content-security-policy/)
 * [Active Topics](https://wordpress.org/support/plugin/cookies-and-content-security-policy/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cookies-and-content-security-policy/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cookies-and-content-security-policy/reviews/)

## Tags

 * [cache](https://wordpress.org/support/topic-tag/cache/)

 * 10 replies
 * 3 participants
 * Last reply from: [Johan Jonk Stenström](https://wordpress.org/support/users/jonkastonka/)
 * Last activity: [1 year, 6 months ago](https://wordpress.org/support/topic/content-blocked-when-using-litespeed-cache/#post-18126715)
 * Status: resolved