cache-control -> Flush private cache

serpent_driver

Well-Known Member
#1
I have either a missunderstanding or cache-control has a bug or documentation is wrong. It's about cache-control directive and to purge private cache with .htaccess RewriteRule.

In LiteSpeed documentation https://docs.litespeedtech.com/lscache/devguide/controls/#cache-control there are usage examples that don't work for me.

Code:
Flush private cache
RewriteRule /flush_cache - [E=cache-control:flush]
If it is set with a RewriteCond to me, private cache will be flushed, but what does flush exactly mean?
Is flush == purge?
If yes, it doesn't work. I have some private ESI cache sections and cache of these sections will not be purged, but may be my rules are wrong or I missunderstand it.

This is how I use this directive:
Code:
RewriteCond %{QUERY_STRING} action=add_product
RewriteRule /flush_cache - [E=cache-control:flush]

***************************************************************************

Code:
Disable auto flush private cache by POST request:
RewriteRule .* - [E=cache-control:no-autoflush]
If not set private cache will be auto-flushed by POST request. I have POST requests, but private cache will not be purged, if flush means purge. Again, what does flush mean? If flush is purge this directive doesn't work for private cache in ESI sections with POST requests.
 

Pong

Well-Known Member
Staff member
#3
"[E=cache-control:flush]" should flush private cache, have you changed "/flush_cache" to the real URI for your application? We will update our doc to make it more clear.
 

serpent_driver

Well-Known Member
#4
Yes, but without success. Updating documentation is a good idea!

[Update]

To get the same function I build a workaround with Client Side Scripting and request a URL that purges private cache if POST is executed. It works, but .js is needed.
 

Pong

Well-Known Member
Staff member
#5
maybe you can log a ticket with us with tmp root ssh and steps to trigger that private cache purge, we can check further.
 
Top