Opened 12 years ago

Closed 12 years ago

#2251 closed bug (WontFix)

iOS 6 Caching WebUI json POST requests

Reported by: Torawk Owned by: Damien Churchill
Priority: minor Milestone: Future
Component: Web UI Version:
Keywords: Cc:


It would seem that iOS is caching the requests to the webui's json interface. This is causing the UI to show what seems like a playback or recorded view of the progress of the torrents -- since it's showing the cached requests which oddly isn't always the same but seemingly changing and eventually sorts it self out. But I see day old torrents randomly for awhile first.

I found this on how iOS's Safari is caching in v6:

No Cache-Control or Expires headers = iOS6 Safari will cache
Cache-Control max-age=0 and an immediate Expires = iOS6 Safari will cache
Cache-Control: no-cache = iOS6 Safari will NOT cache

via which has some more details.

And it seems to be new with iOS 6.

I was able to fix it locally with a single line change to

@@ -274,6 +274,7 @@ class JSON(resource.Resource, component.
     def _send_response(self, request, response):
         response = json.dumps(response)
         request.setHeader("content-type", "application/x-json")
+        request.setHeader("cache-control","no-cache")
         request.write(compress(response, request))

This was seen with 1.3.5 on Ubuntu installed via the ppa.

Change History (2)

comment:1 by Calum, 12 years ago

I am not sure whether applying this due to a bug in Safari is a good idea.

Also apparently this is fixed in Safari 6.1 so by the time our next release with a workaround is out it would be irrelevant.

comment:2 by Torawk, 12 years ago

Resolution: wontfix
Status: newclosed

If it's fixed in iOS 6.1's Safari then Apple sees it as a bug themselves (Something I wasn't really counting on) and likely affects many other projects.

I'll close it for now -- if 6.1 is released and there's still an issue perhaps I'll reopen.

Note: See TracTickets for help on using tickets.