Front page cached after user logs in
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Front page cached after user logs in
Laravel framework version: 9.52.4
Aimeos Laravel version: ~2022.10
PHP Version: 8.2.3
Environment: Linux
Hello,
I use the following check inside /packages/<my-theme>/views/base.blade.php to determine if the user is logged:
@if (Auth::guest())
user is not logged in
@else
user is logged in
@endif
After logging in and opening the front page, the result of @if (Auth::guest()) is still true (user not logged in).
The cache is cleared when I reload the page in chrome via the shortcut CTRL+SHIFT+R, which ignores cached content.
The cache is also cleared when I load the page via entering the URL to the home page in the address bar.
But clicking the logo leads to the cached homepage, where it appears like the user is still not logged in.
This cache stays for about 30 seconds.
The logo uses {{ airoute('aimeos_home') }}
Do you know how to solve this?
Aimeos Laravel version: ~2022.10
PHP Version: 8.2.3
Environment: Linux
Hello,
I use the following check inside /packages/<my-theme>/views/base.blade.php to determine if the user is logged:
@if (Auth::guest())
user is not logged in
@else
user is logged in
@endif
After logging in and opening the front page, the result of @if (Auth::guest()) is still true (user not logged in).
The cache is cleared when I reload the page in chrome via the shortcut CTRL+SHIFT+R, which ignores cached content.
The cache is also cleared when I load the page via entering the URL to the home page in the address bar.
But clicking the logo leads to the cached homepage, where it appears like the user is still not logged in.
This cache stays for about 30 seconds.
The logo uses {{ airoute('aimeos_home') }}
Do you know how to solve this?
Re: Front page cached after user logs in
I've done a temporary solution by overriding the CatalogController::homeAction() and removing the 30 second cache header, but waiting for a better solution, because it doesn't act like this by default on a clean installation.
Re: Front page cached after user logs in
It may makes sense to remove the browser caching in case the user is logged in. If you can create a PR, that checks Auth::user(), we will merge it into the Aimeos Laravel package.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Front page cached after user logs in
My solution was actually not that good, removing the cache only from the home page action doesn't solve it for the other pages, where it still appears like the user is not logged in, when he actually is logged in...
Re: Front page cached after user logs in
Guess, browser caching needs to be removed from all catalog controller actions in your case:
https://github.com/aimeos/aimeos-larave ... roller.php
https://github.com/aimeos/aimeos-larave ... roller.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
