Conversation
|
This might partially work, but I would suggest to at least also also add cache clearing to |
Partially is still better than never 😁.
Makes sense 👍. I will add it to the PR. |
|
I have added it to |
| Database::getInstance()->query("TRUNCATE " . static::$strTable); | ||
|
|
||
| if (System::getContainer()->has('fos_http_cache.cache_manager')) { | ||
| System::getContainer()->get('fos_http_cache.cache_manager')->invalidateTags(['contao.db.tl_iso_product']); |
There was a problem hiding this comment.
this would not clear the reader pages though, right?
There was a problem hiding this comment.
Only the product list uses the ProductCache.
There was a problem hiding this comment.
yes, but this method is called all over the place where the cache of products should be cleared. E.g. if the store configuration is changed, the reader pages might display a wrong currency. So it would kinda make sense to clear them as well? Although we would be better off actually implementing the correct tags. Which is why this might not make sense as a quick fix in 2.9 🙈
There was a problem hiding this comment.
Although we would be better off actually implementing the correct tags.
I can add the additional cache tags in this PR if you want.
Which is why this might not make sense as a quick fix in 2.9
Why? It's a bug in 2.9 and can easily be fixed there.
There was a problem hiding this comment.
idk, its also a feature of Contao that is not supported by Isotope 🤷
There was a problem hiding this comment.
HTTP caching you mean?
There was a problem hiding this comment.
But again: it's better than to clear the cache not at all, is it not? Having this issue again in a project.
Currently, if a page with a product list is in the shared HTTP cache and a new product is added, deleted or a product is changed, the cache will not be invalidated. Likewise if a product detail is in the shared HTTP cache and that product is changed, the shared cache is also not invalidated.
This PR fixes that by adding at least the general
contao.db.tl_iso_productcache tag for any product list and thecontao.db.tl_iso_product.*cache tag for any product detail. Both will get automatically invalidated by theDataContainerin the back end when editing products.