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.
So far I can think of two options:
1. Scrap and recreate the entire cache
2. Load the custom fields with AJAX
I am not sure which is faster. Perhaps it depends on the number of visitors 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?
Any ideas are welcome. Many thanks