• Resolved asafm7

    (@asafm7)


    Hello.

    Is there an easy way to send Cache-Control: no-cache for LiteSpeed cache excludes?

    Currently, only X-LiteSpeed-Cache-Control: no-cache is sent.

    I’m trying to make a CDN bypass LiteSpeed cache excludes.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support qtwrk

    (@qtwrk)

    logically , all dynamic page generated by wordpress should have this header so browser won’t cache it

    assuming all of your pages ends with / , then you can use

    	SetEnvIf Request_URI "/$" change_header
    	Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0" env=change_header
    Thread Starter asafm7

    (@asafm7)

    Thanks @qtwrk.

    logically , all dynamic page generated by wordpress should have this header so browser won’t cache it

    It seems WordPress doesn’t send no-cache by default. Maybe it is enough not to have a Cache-Control header for browsers to avoid caching.

    I think this is the code I was looking for. Let me know if you think I’m missing something:

    $is_litespeed_cacheable = apply_filters('litespeed_control_cacheable', false);
    
    if (!$is_litespeed_cacheable) {
        nocache_headers();
    }

    Thanks again.

    Plugin Support qtwrk

    (@qtwrk)

    Personally I would like to avoid browser cache at any case for page itself, but only for static resources, that’s why I suggested above code

    Thread Starter asafm7

    (@asafm7)

    Thanks @qtwrk.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cache-Control: no-cache for cache excludes’ is closed to new replies.