nextcloud / nextcloud/server

WebCal export : Support for HTTP header `If-Modified-Since`

Open
#29,309 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop enhancement feature: caldav feature: dav feature: sharing
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Is your feature request related to a problem? Please describe.

Hi there, it seems the caldav integration does ignore basic caching mechanisms. The server always responds with:

HTTP/1.1 200 OK
Date: Mon, 18 Oct 2021 21:38:04 GMT

(which is the current date and time)

This makes all attempts to set the If-Modified-Since header impossible.

GET /remote.php/dav/public-calendars/XXX?export HTTP/1.1
If-Modified-Since: Mon, 18 Oct 2021 21:38:04 GMT
...

The calendar will be downloaded regardless if it has any changes or not.
This is especially data-consuming if you want to sync a calendar every 5 minutes.

Describe the solution you'd like

Instead, the calendar app could return the date of the last modification and respect the If-Modified-Since header and return a HTTP 304 status code. That way no unnecessary data is transmitted.

Describe alternatives you've considered
N/A

Additional context
Use Case scenario: A mirrored ical file that is downloaded every 5 minutes to a different server. It is crucial to reflects recent changes as soon as possible and yet don't download the ical 288 times a day if there are no changes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the WebCal export endpoint for the CalDAV public-calendar URL, and trace how its response date is currently generated. Review the existing request handling for If-Modified-Since and the calendar's last modification time. Done means unchanged calendars return HTTP 304 and changed calendars return the calendar data with an accurate modification date.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.