Template fragment cache for periodically updating?
-
I have a question about best practice for caching.
I have a CMS system outside of nodebb. It generates header HTML that I need to import into nodebb.
This needs to be rechecked periodically because the CMS build is using cache busting hash URLs, so urls to things like image and css assets will always change, as in /imgs/foo-XYZHASH.jpg. Outside of that problem, the header is already being served on a URL by itself, like mysite.com/header.html
I'm imagining the least painful way to do this is to fetch() the HTML in a nodebb widget or template, cache it, and recheck it periodically.
Is there any precedent for this kind of pattern? I've read about @baris's work https://community.nodebb.org/topic/17136/caches-used-in-nodebb but I'm still not sure how this should all fit together.
Thanks for any guidance.
-
As in client side fetch? This is critical HTML that would block renders so that would be pretty bad. It's the header and has some search functionality in it, for example.
On the other hand, if there was something like a remote-html convention for the widgets that fetched on server and expired the cache automatically, never blocked render, etc... that would be cool but I'm not sure how or where to see how caching works in these kind of cases.