Cache issue
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!
Cache issue
Hi, I'm using a version of it:
Laravel Framework 8.83.27
"aimeos/aimeos-laravel": "~2020.10"
PHP 7.4.30
I have added a root for category output:
Route::get('category/{category_name?}', '\Aimeos\Shop\Controller\CatalogController@listAction')->name('aimeos_shop_list_category');
I'm using the default controller
vendor/aimeos/aimeos/aimeos-laravel/src/Aimeos/Shop/Controller/CatalogController.php
The problem is the following, I see that the cache is not working correctly, it always caches the first page to which the transition occurs.
i.e. if I go to http://aimeos-shop.local.com/category/test_1.
it will cache it, and if I go to another category - http://aimeos-shop.local.com/category/test_2.
The cache will pull up the HTML for the test_1 category.
The only solution is to go to /ext/ai-client-html/client/html/src/Client/Html/Base.php and in the getParamHash method.
add request()->getRequestUri() to $pstr.
The question is, how should this work, why is the cache only caching the first page?
Laravel Framework 8.83.27
"aimeos/aimeos-laravel": "~2020.10"
PHP 7.4.30
I have added a root for category output:
Route::get('category/{category_name?}', '\Aimeos\Shop\Controller\CatalogController@listAction')->name('aimeos_shop_list_category');
I'm using the default controller
vendor/aimeos/aimeos/aimeos-laravel/src/Aimeos/Shop/Controller/CatalogController.php
The problem is the following, I see that the cache is not working correctly, it always caches the first page to which the transition occurs.
i.e. if I go to http://aimeos-shop.local.com/category/test_1.
it will cache it, and if I go to another category - http://aimeos-shop.local.com/category/test_2.
The cache will pull up the HTML for the test_1 category.
The only solution is to go to /ext/ai-client-html/client/html/src/Client/Html/Base.php and in the getParamHash method.
add request()->getRequestUri() to $pstr.
The question is, how should this work, why is the cache only caching the first page?
Re: Cache issue
The parameter name "category_name" isn't used to calculate the hash for caching. If you name the parameter "f_..." (e.g. "f_catname"), then caching should work as expected. Here's the reference in the code:
https://github.com/aimeos/ai-client-htm ... rd.php#L99
https://github.com/aimeos/ai-client-htm ... rd.php#L99
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Cache issue
It seems that with this approach, all products from all categories are displayed in one category, and there is also caching on the 1st access.
Re: Cache issue
If you didn't pass the new parameter as search filter to the Aimeos product controller, you will get back all products from all categories for sure.
With the new parameter, caching is still applied but now, the value of the parameter is taken into account when calculating the cache hash.
With the new parameter, caching is still applied but now, the value of the parameter is taken into account when calculating the cache hash.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star