• Resolved Mikko Saari

    (@msaari)


    When using LS Cache with ActivityPub, sometimes the JSON content from ActivityPub gets cached instead of the actual page. Both versions are served from the same URL, but the ActivityPub request comes with an Accept: application/activity+json header.

    Is there a way to prevent LS Cache from caching the JSON output, or to have a different cache for those requests?

Viewing 7 replies - 16 through 22 (of 22 total)
  • Plugin Support qtwrk

    (@qtwrk)

    @msaari does my vary rewrite rule solve the issue ?

    Thread Starter Mikko Saari

    (@msaari)

    I’ve added the rewrite rules now, and I’ll know if I don’t get any complaints. I don’t have a reliable way to reproduce the problem.

    Plugin Support qtwrk

    (@qtwrk)

    please make sure you place it at top of htaccess, before any other rule that has [L] flag

    Thread Starter Mikko Saari

    (@msaari)

    Yeah, it’s the first thing. Does it need RewriteEngine on in it?

    Plugin Support qtwrk

    (@qtwrk)

    well , for LiteSpeed WebServer, it usually doesn’t need , but for the purpose of perfection and profession, let’s make it this way , it doesn’t hurt to add it anyway 🙂

    <IfModule LiteSpeed>
    RewriteEngine On
    RewriteCond %{HTTP:Accept} application
    RewriteRule ^ - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+isjson]
    </IfModule>
    • This reply was modified 1 year ago by qtwrk.

    @qtwrk Is there a way to reuse LiteSpeed functions to add the rewrite rules?

    Maybe a function in htaccess.cls.php ??

    Plugin Support qtwrk

    (@qtwrk)

    well , I’d suggest not to use our htaccess.cls.php function

    it should be simple as prepend this rule at top of .htaccess (the order of rule , matters ) , our htaccess cls php may not always insert it at top of .htaccess

Viewing 7 replies - 16 through 22 (of 22 total)

The topic ‘Avoiding caching ActivityPub content’ is closed to new replies.