Hypervisor Posted September 18, 2021 Posted September 18, 2021 (edited) The docs say: Quote Block caching Custom blocks can optionally be cached, meaning the resources required to render the block are reduced. If your block is dynamic in any way (such as rendering differently based on the user viewing it, or the page it is being shown on), you should ensure that caching is not used. I can't find any setting that actually has to do with block caching? These docs say I should ensure that caching for blocks is off but doesn't actually say how to do that. Is this the same caching setting as "cache page output for guests?" I have a custom block that iterates over database records (a feed block) but it doesn't update immediately upon refresh when the underlying record changes. I'm assuming this is caching-related but I can't find any resources on manually handling this for plugin blocks. Thank you in advance for any insight you can provide! Edited September 18, 2021 by Hypervisor
TDBF Posted September 18, 2021 Posted September 18, 2021 (edited) 1 hour ago, Hypervisor said: The docs say: I can't find any setting that actually has to do with block caching? These docs say I should ensure that caching for blocks is off but doesn't actually say how to do that. Is this the same caching setting as "cache page output for guests?" I have a custom block that iterates over database records (a feed block) but it doesn't update immediately upon refresh when the underlying record changes. I'm assuming this is caching-related but I can't find any resources on manually handling this for plugin blocks. Thank you in advance for any insight you can provide! You will find block cache settings in the AdminCP, System/Settings/Advanced Configuration under the 'Server Environment' tab and then look for Performance. You will see 'Cache sidebar, header and footer blocks' settings. However, you cannot turn block settings off, but you can bring it down to 1 minute. Edited September 18, 2021 by TDBF Marc 1
Marc Posted September 19, 2021 Posted September 19, 2021 That is correct. Could you clarify what you mean when you say "These docs"? We would not actually recommend you wish caching off
Yamamura Posted September 19, 2021 Posted September 19, 2021 1 hour ago, Marc Stridgen said: That is correct. Could you clarify what you mean when you say "These docs"? We would not actually recommend you wish caching off
Solution TDBF Posted September 19, 2021 Solution Posted September 19, 2021 7 hours ago, Yamamura said: You mean when you create a Page block? Yes there are some instances where you can cache a block, and these are normally with 'custom' page block, and will be found on the content tab underneath the editor window. Like this: Marc 1
Marc Posted September 20, 2021 Posted September 20, 2021 The selection on whether or not to cache a block is when you create a custom block with custom content, and create this from the admin CP. You will not see this on standard blocks you add on the front end of the site TDBF and Hypervisor 1 1
Hypervisor Posted September 27, 2021 Author Posted September 27, 2021 (edited) On 9/20/2021 at 2:52 AM, Marc Stridgen said: The selection on whether or not to cache a block is when you create a custom block with custom content, and create this from the admin CP. You will not see this on standard blocks you add on the front end of the site Hi Marc, Sorry I didn't link the docs! What Yamamura linked to is correct (specifically the bottom paragraph). Given that the block I'm using is a Feed Block, is it supposed to not always be in sync with the DB records it's showing due to the caching? If I change the field on a record, it will only update after a certain amount of time or if I go to System -> Clear System Caches. Interestingly enough however, another block that comes from a plugin the same exact template updates immediately (it's in the forum header and not the body, so not sure if that makes a difference). Thanks! Edited September 27, 2021 by Hypervisor
Recommended Posts