openhab-core
openhab-core copied to clipboard
[rest] Add caching for add-on resource
As there are no registry listeners to use, I decided to listen to AddonEvent
s.
/cc @jimtng
No, I’m not sure.
Do you know a better way to detect changes?
The remote add-on services cache their content, too. The refresh time is 15 min, so I guess an automatic expiry of the cache with half of that would probably mitigate the issue.
Thanks for the idea, I have just pushed that!
FYI I switched from having a CACHE_CONTROL
constant on RESTConstants
to having a default cache control getter on the RESTConstant
class to migitate to risk that somewhere the const could be modified which would then apply to all places where the const is used.
@J-N-K Can you please have a look at this PR?
@J-N-K Done :+1:
Sign-Off is missing for the revert commit, hope that's okay. Otherwise I need to force push ...