I would like to use REST API to update custom fields on various pages - an example would be tracking outside temperature, humidity, etc from a sensor. However, if the website has cache, the pages won't update with the new information in the custom fields.
How can I "punch holes" in the cache so only these fields are updated without regenerating the entire cache for the page?
I thought of object cache but that is for DB queries and probably won't be suitable for this purpose.
Any ideas are welcome. Many thanks
EDIT: So far I can think of two options:
- Scrap and recreate the entire cache
- Load the custom fields with AJAX
- Server Side Events
I am not sure which is faster. Perhaps it depends on the number of visitors and the frequency of data updates which might cause massive amounts of AJAX calls while the cache is created only once. What is the standard approach in situations where you want to present up-to-date information on the website?