After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 630265 - Refetches unchanged 'On The Web' calendar
Refetches unchanged 'On The Web' calendar
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Calendar
2.32.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-calendar-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2010-09-21 13:52 UTC by David Woodhouse
Modified: 2013-09-14 16:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
eds patch (2.92 KB, patch)
2010-09-27 18:25 UTC, Milan Crha
committed Details | Review

Description David Woodhouse 2010-09-21 13:52:01 UTC
Evolution is repeatedly refetching a rather large calendar via HTTP when it hasn't changed. Isn't there some way (HTTP 'HEAD' request) that this could be avoided?
Comment 1 Milan Crha 2010-09-24 14:13:24 UTC
I'm afraid there isn't. CalDAV has an extension, called getctag, which is similar to etag in webdav, just the ctag is a 'calendar tag', and changes whenever the calendar is modified.

Dan, do you know of any header suitable for "did it change" query for a web calendar, which is just a simple file download through libsoup? Something like last modification time or anything like that.
Comment 2 David Woodhouse 2010-09-24 14:26:09 UTC
And/or the ETag...

[dwmw2@i7 libical]$ telnet casper 80
Trying 2001:770:15f::2...
Connected to casper.
Escape character is '^]'.
HEAD /whatever.ics HTTP/1.1
Host: david.woodhou.se 

HTTP/1.1 200 OK
Date: Fri, 24 Sep 2010 14:25:28 GMT
Server: Apache/2.2.15 (Fedora)
Last-Modified: Fri, 30 Jul 2010 06:42:00 GMT
ETag: "681e3-2a47-48c9525db7e00"
Accept-Ranges: bytes
Content-Length: 10823
Connection: close
Content-Type: text/calendar

Connection closed by foreign host.
Comment 3 Dan Winship 2010-09-24 14:35:56 UTC
you can do either

  If-Modified-Since: TIMESTAMP

or

  If-None-Match: ETAG

(where TIMESTAMP can be generated with soup_date_to_string() with
SOUP_DATE_HTTP, or an equivalent strftime() invocation). If it hasn't changed
you'll get back "304 Not Modified" and no body. (In theory. The server might not implement conditional requests, in which case it would ignore the If-* header and just return the full body anyway.)
Comment 4 David Woodhouse 2010-09-24 14:43:52 UTC
Sounds perfect; thanks.
Comment 5 Milan Crha 2010-09-27 18:25:58 UTC
Created attachment 171226 [details] [review]
eds patch

for evolution-data-server;

Thanks Dan.

Because www.gnome.org also supports ETag, then I chose that one. The patch also fixes an issue with "Refresh" on a webcal calendar, it didn't work until the first refetch. I added a debugging with WEBCAL_DEBUG to it too, to see what is sent/received through libsoup.
Comment 6 Milan Crha 2010-09-27 18:31:02 UTC
Created commit cb78293 in eds master (2.91.1+)
Created commit 66226a0 in eds gnome-2-32 (2.32.1+)
Comment 7 David Woodhouse 2010-09-28 01:08:50 UTC
Works well here too; thanks. (I cherry-picked into my 2.30 build)