openhab-core/bundles
Yannick Schaus 6e83d3f8de
"Cacheability" option for critical REST resources (#3335)
* Closes #3329.

This implements a new optional `cacheable` parameter for these REST endpoints:
- `/rest/items`
- `/rest/things`
- `/rest/rules`

When this parameter is set, a flat list of all elements excluding
non-cacheable fields (e.g. "state", "transformedState", "stateDescription",
"commandDescription" for items, "statusInfo", "firmwareStatus",
"properties" for things, "status" for rules) will be retrieved along with
a `Last-Modified` HTTP response header. When unknown, the Last-Modified
header will be set to the date of the request.

Also only when this parameter is set, and a `If-Modified-Since` header is
found in the request, that header will be compared to the last known
modified date for the corresponding cacheable list. The last modified date
will be reset when any change is made on the elements of the underlying
registry. If the `If-Modified-Since` date is equal or more recent than the
last modified date, then a 304 Not Modified response with no content will
be served instead of the usual 200 OK, informing the client that its
cache is still valid at the provided date.

All other request parameters will be ignored except for "metadata" in the
`/rest/items` endpoint. When a metadata selector is set, the resulting
item list will be considered like a completely different resource, i.e.
it will have its own last modified date. Regarding metadata, the approach
to invalidating last modified dates is very conservative: when any metadata
is changed, all cacheable lists of items will have their last modified date
reset even if the change was in a metadata namespace that wasn't requested.

This also implements the abovedescribed behavior for the
`/rest/ui/components/{namespace}` endpoint, but no `cacheable` parameter
is necessary. The last modified date is tracked by namespace.

Signed-off-by: Yannick Schaus <github@schaus.net>
2023-06-15 20:16:14 +02:00
..
org.openhab.core New Crowdin updates (#3639) 2023-05-29 14:26:59 +02:00
org.openhab.core.addon Redefine connection in addon.xsd (#3563) 2023-04-20 20:36:44 +02:00
org.openhab.core.addon.eclipse Add Eclipse Add-on Service (#3406) 2023-03-02 07:41:49 +01:00
org.openhab.core.addon.marketplace Improve community marketplace addon handler (#3641) 2023-06-11 22:36:34 +02:00
org.openhab.core.addon.marketplace.karaf Fix IllegalStateException in CommunityKaraAddonHAndler (#3528) 2023-04-07 09:44:28 +02:00
org.openhab.core.audio New Crowdin updates (#3639) 2023-05-29 14:26:59 +02:00
org.openhab.core.auth.jaas Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.auth.oauth2client Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.automation New Crowdin updates (#3639) 2023-05-29 14:26:59 +02:00
org.openhab.core.automation.module.media Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.automation.module.script New Crowdin updates (#3639) 2023-05-29 14:26:59 +02:00
org.openhab.core.automation.module.script.rulesupport Remove redundant public and abstract modifiers from interfaces (#3560) 2023-04-20 20:22:58 +02:00
org.openhab.core.automation.rest "Cacheability" option for critical REST resources (#3335) 2023-06-15 20:16:14 +02:00
org.openhab.core.config.core New Crowdin updates (#3639) 2023-05-29 14:26:59 +02:00
org.openhab.core.config.discovery Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.config.discovery.mdns Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.config.discovery.upnp Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.config.discovery.usbserial Remove redundant public and abstract modifiers from interfaces (#3560) 2023-04-20 20:22:58 +02:00
org.openhab.core.config.discovery.usbserial.linuxsysfs Fix resource leak in SysfsUsbSerialScanner (#3513) 2023-04-01 11:32:53 +02:00
org.openhab.core.config.discovery.usbserial.ser2net [serial] Ability to use /dev/serial/ symlinks for usb serial device (#3290) 2023-03-04 14:43:46 +01:00
org.openhab.core.config.dispatch Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.config.serial Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.ephemeris [ephemeris] Add support for overriding holiday definitions (#3573) 2023-05-02 09:11:59 +02:00
org.openhab.core.id Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.io.bin2json Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.io.console Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.io.console.eclipse Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.io.console.karaf Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.io.console.rfc147 Remove redundant public and abstract modifiers from interfaces (#3560) 2023-04-20 20:22:58 +02:00
org.openhab.core.io.http Upgrade to Karaf 4.4.3 (#3252) 2023-03-01 13:09:07 +01:00
org.openhab.core.io.http.auth Code cleanup: Use Java 17 features (#3585) 2023-05-01 08:27:15 +02:00
org.openhab.core.io.jetty.certificate Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.io.monitor EventLogger minor refactor (#3523) 2023-04-07 19:47:01 +02:00
org.openhab.core.io.net Code cleanup: Use Java 17 features (#3585) 2023-05-01 08:27:15 +02:00
org.openhab.core.io.rest [rest] Add endpoint for UoM information (#3611) 2023-05-27 21:10:32 +02:00
org.openhab.core.io.rest.audio Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.io.rest.auth Fix AuthFilter service declaration (#3651) 2023-06-11 21:22:26 +02:00
org.openhab.core.io.rest.core "Cacheability" option for critical REST resources (#3335) 2023-06-15 20:16:14 +02:00
org.openhab.core.io.rest.log Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.io.rest.mdns Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.io.rest.sitemap Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.io.rest.sse [sse] Add type information to state event (#3647) 2023-06-08 14:31:34 +02:00
org.openhab.core.io.rest.swagger Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.io.rest.transform Add dynamic scripting-language transformation service (#3487) 2023-04-12 21:56:06 +02:00
org.openhab.core.io.rest.ui "Cacheability" option for critical REST resources (#3335) 2023-06-15 20:16:14 +02:00
org.openhab.core.io.rest.voice [tts] Cache mechanism (#3057) 2023-02-28 08:45:44 +01:00
org.openhab.core.io.transport.mdns Remove redundant public and abstract modifiers from interfaces (#3560) 2023-04-20 20:22:58 +02:00
org.openhab.core.io.transport.modbus Code cleanup: Use Java 17 features (#3585) 2023-05-01 08:27:15 +02:00
org.openhab.core.io.transport.mqtt Remove redundant public and abstract modifiers from interfaces (#3560) 2023-04-20 20:22:58 +02:00
org.openhab.core.io.transport.serial Remove redundant public and abstract modifiers from interfaces (#3560) 2023-04-20 20:22:58 +02:00
org.openhab.core.io.transport.serial.javacomm Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.io.transport.serial.rxtx Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.io.transport.serial.rxtx.rfc2217 Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.io.transport.upnp Remove redundant public and abstract modifiers from interfaces (#3560) 2023-04-20 20:22:58 +02:00
org.openhab.core.io.websocket [websocket] Allow registering websocket adapters (#3622) 2023-06-10 15:35:23 +02:00
org.openhab.core.karaf Remove package support from FeatureInstaller (#3634) 2023-05-27 19:14:48 +02:00
org.openhab.core.model.codegen Renamed packages 2019-12-28 12:18:16 +01:00
org.openhab.core.model.core Remove redundant public and abstract modifiers from interfaces (#3560) 2023-04-20 20:22:58 +02:00
org.openhab.core.model.item Code cleanup: Use Java 17 features (#3585) 2023-05-01 08:27:15 +02:00
org.openhab.core.model.item.ide Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.model.item.runtime Bump spotless and fix formatting (#3469) 2023-03-20 23:14:59 +01:00
org.openhab.core.model.lazygen Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.model.lsp New Crowdin updates (#3638) 2023-05-28 13:20:05 +02:00
org.openhab.core.model.persistence Allow managing persistence configurations and enable filters (#2871) 2023-05-07 20:33:28 +02:00
org.openhab.core.model.persistence.ide Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.model.persistence.runtime Bump spotless and fix formatting (#3469) 2023-03-20 23:14:59 +01:00
org.openhab.core.model.rule Bump spotless and fix formatting (#3469) 2023-03-20 23:14:59 +01:00
org.openhab.core.model.rule.ide Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.model.rule.runtime Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.model.script New Crowdin updates (#3639) 2023-05-29 14:26:59 +02:00
org.openhab.core.model.script.ide Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.model.script.runtime Add group name to GroupStateTriggerHandler (#3536) 2023-05-27 21:30:34 +02:00
org.openhab.core.model.sitemap Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.model.sitemap.ide Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.model.sitemap.runtime Bump spotless and fix formatting (#3469) 2023-03-20 23:14:59 +01:00
org.openhab.core.model.thing Fix thing reloading from things file (#3526) 2023-04-15 09:16:32 +02:00
org.openhab.core.model.thing.ide Update license header to 2023 (#3294) 2023-01-03 09:45:42 +01:00
org.openhab.core.model.thing.runtime Bump spotless and fix formatting (#3469) 2023-03-20 23:14:59 +01:00
org.openhab.core.persistence Add getAllStatesSince() and getAllStatesBetween() to PersistenceExtensions (#3466) 2023-05-27 21:33:48 +02:00
org.openhab.core.semantics [uom] Add unit metadata for NumberItem (#3481) 2023-05-09 22:42:25 +02:00
org.openhab.core.storage.json Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.test Trigger immediately when start level already reached (#3278) 2023-05-28 10:14:03 +02:00
org.openhab.core.test.magic Code cleanup: Use Java 17 features (#3522) 2023-04-16 21:43:59 +02:00
org.openhab.core.thing New Crowdin updates (#3589) 2023-05-13 17:54:26 +02:00
org.openhab.core.transform Fix exception in TransformationHelper (#3627) 2023-05-25 08:36:45 +02:00
org.openhab.core.ui Remove redundant public and abstract modifiers from interfaces (#3560) 2023-04-20 20:22:58 +02:00
org.openhab.core.ui.icon Icon server: remove old style request with the state in the URL (#3548) 2023-04-18 10:48:39 +02:00
org.openhab.core.voice New Crowdin updates (#3638) 2023-05-28 13:20:05 +02:00
antlr-generator-3.2.0-patch.jar [model] don't require to download antlr generator on build time (#810) 2019-05-14 09:04:35 +02:00
pom.xml Add Eclipse Add-on Service (#3406) 2023-03-02 07:41:49 +01:00