]> source.dussan.org Git - nextcloud-server.git/commit
perf(dav): skip non-calendar requests in webcal caching plugin 44511/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Wed, 27 Mar 2024 16:48:43 +0000 (17:48 +0100)
committerDaniel Kesselberg <mail@danielkesselberg.de>
Wed, 27 Mar 2024 19:04:23 +0000 (20:04 +0100)
commit4bdb473aae8307d4be59bc7975eca4e6e962c739
tree5bc4bf3b738de15feeee4feb822f8001dd4cb313
parent9afcec721fdc75c876bb62cc2de8295280ed4810
perf(dav): skip non-calendar requests in webcal caching plugin

The webcal caching plugin is active when the X-NC-CalDAV-Webcal-Caching header is there.

findPrincipalByUrl sends a request for /remote.php/dav/principals/users/admin/ using the caldavService which sets the header by default.[^1]

As X-NC-CalDAV-Webcal-Caching only impacts calendar requests, we can skip non-calendar requests.

[^1]: https://github.com/nextcloud/calendar/blob/b3670f1805ef9ef952d6abe4e5334e37b5a14133/src/services/caldavService.js#L43

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
apps/dav/lib/CalDAV/WebcalCaching/Plugin.php
apps/dav/tests/unit/CalDAV/WebcalCaching/PluginTest.php