Replies: 2 comments 1 reply
-
The real draw back is that it's a bit slower. Laravel still has to boot up on every request. Everything else pretty much works the same way.
That line is saying that only that item's URL will be invalidated. e.g. if you save the entry that lives at You'll need to set up the invalidation rules. e.g. You should set it up so that when you save a blog entry, you'll also want to invalidate the blog listing. On your Alpine driven listing, if you're always getting all the artists and then just filtering them down with JS, then you're correct in that you don't need the nocache tag. But, you'll wanna make sure to invalidate this URL when you save an artist. Same deal with the events listing. Adjust your rules so that when you save an event, it'll invalidate that listing. |
Beta Was this translation helpful? Give feedback.
-
Thanks Jason! Ok so I use this syntax to declare special rules: return [
'class' => null,
'invalidation' => [
'rules' => [
'collections' => [
'blog' => [
'urls' => [
'/blog',
'/blog/category/*',
'/',
]
],
],
]
]
];
🙏 |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I´m trying to wrap my head around the static caching, and I have some questions:
If I'm setting
STATAMIC_STATIC_CACHING_STRATEGY=half
I'm activating half measure caching like it says in the docs and … its very fast :)And since "full measure" is a little too much for me atm with server settings, nginx, etc. I want to go with "half" … So what's the draw back? If I'm understanding correctly, with every content save, the corresponding "cache item" gets "freshly cached" as it says here:
So two questions:
I have "related entries (events)" in a collection "artists". They have a many-to-many relation via this addon. So I'm assuming, if the artists is edited and saved, it gets invalidated everywhere its content is used (in the index page, the show page, anywhere
{{collection:artists}}
is used, correct? But what about the related entries? Do I have to invalidate those entries via a specific rule, or do they get invalidated automatically? And if so, how to declare related entries in thestatic_caching.php
?I dont really get what I have to wrap into
{nochache}
tags … ok dynamic content, but: For example, I have a list of artists, which I filter via Alpine.js. So no need for{nocache}
because they are are static, right? And If there are changes to one artists, it will automatically invalidate, because its saved again and therefore invalidated, correct?Second Example: I have an artist "show/detail" page, where there are listed the upcoming events. This is done like so
{{ events events:start_date:is_after="today" }}
. Seems dynamic … but, if I make changes to an event, or I make changes to an artist, this will – again – invalidate the artists page. So where is the need for a{nochache}
tag? And more importanly, did I get something wrong here?Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions