.htaccess
test.php
Testing using curl:
first call:
later calls:
That is good!
first call:
later calls:
That is bad. How do I fix this?
<IfModule LiteSpeed>
RewriteEngine On
CacheLookup public on
RewriteCond %{HTTP:Accept-Language} ^de [NC]
RewriteRule .* - [E=Cache-Control:vary=de]
</IfModule>
test.php
<?php
header('Content-type: image/svg+xml');
header('X-LiteSpeed-Cache-Control: public,max-age=30'); // In the actual application max-age is a calculated value
?>
Testing using curl:
curl -v "https://www.example.com/test.php" -H "Accept-Language: en"
first call:
x-litespeed-cache: miss
x-litespeed-cache: hit
curl -v "https://www.example.com/test.php" -H "Accept-Language: de"
first call:
x-litespeed-cache: miss
x-litespeed-cache: miss