Skip to content

Commit

Permalink
Handle language switcher
Browse files Browse the repository at this point in the history
Fixed #1
  • Loading branch information
rafaucau committed Dec 2, 2021
1 parent 03fe459 commit ec15ff1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ composer require acpl/flarum-lscache:"*"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
# Detection of logged-in user.
RewriteRule .* - [E="Cache-Vary:flarum_remember,flarum_lscache_vary"]
RewriteRule .* - [E="Cache-Vary:flarum_remember,flarum_lscache_vary,locale"]
# If you have a non-default path to the admin panel, change "admin" to match.
RewriteCond %{ORG_REQ_URI} !/admin
# Enable private cache for admin panel. If it causes problems replace "private" with "no-cache".
Expand Down
2 changes: 1 addition & 1 deletion src/Middleware/VaryCookieMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface

$response = $response->withHeader(
LSCacheHeadersEnum::VARY,
"cookie={$this->cookie->getName(LSCache::VARY_COOKIE)},cookie={$this->cookie->getName('remember')}",
"cookie={$this->cookie->getName(LSCache::VARY_COOKIE)},cookie={$this->cookie->getName('remember')},cookie=locale",
);

$user = RequestUtil::getActor($request);
Expand Down

0 comments on commit ec15ff1

Please sign in to comment.