Read notification in Kinto

90 views Asked by At

In Kinto I would like to get read notifications. I have following settings:

kinto.event_listeners = testev
kinto.event_listeners.testev.actions = read
kinto.event_listeners.testev.use = fnc_testev

The notification is triggered, but only once. To receive it again, I have to UPDATE the record and after that, the first GET triggers notification again. Additional identical GET requests receive correct HTTP response, but no notification to fnc_testev. Is that by design, or am I missing something?

In fact, I would like to get read notification after the transaction commit (AfterResourceRead). Is that available in Kinto?

1

There are 1 answers

0
ljweko On

HTTP header Cache-Control: no-store does not help. Kinto internally detects Not Modified condition, but returns cached response (possibly modified in read notification, so this is OK for me). To trigger read notification again, use ?_since=timestamp in query string or If-None-Match HTTP header.

To get after read notification, I used Kinto plugin and config_add_subscriber function.