OpenSprinkler Forums OpenSprinkler Mobile and Web App Caching oddities when using both the mobile app and browser interfaces Reply To: Caching oddities when using both the mobile app and browser interfaces

#37028

Brian
Participant

Thanks Samer,

I had a quick look at the headers that are being returned by OS and noticed something that is likely contributing to the caching issue. It would seem that some of the standard cache control headers are not being set in the JSON responses that likely invokes some default caching behavior on some browsers. Currently OS 2.1.3 is setting “Pragma: no-cache”, in the response but nothing is set in the browser request. The HTTP 1.0 spec specifies either setting “Pragma: no-cache” in the request, or the “Expires” and “Last-Modified” dates in the past in the response so the data is not cached.

Since the OS is responding with HTTP 1.0, the kitchen sink “Cache-Control:max-age=0, no-cache, no-store, must-revalidate” response header for HTTP 1.1 will likely not work (unless going through a HTTP 1.0->1.1 proxy), but may be worth adding for those using a reverse HTTPS->HTTP proxy to protect their OS from snooping or MITM attacks.