Details
-
Type:
Bug
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: Firefly
-
Labels:None
-
Story Points:6
-
Epic Link:
-
Sprint:SUIT Sprint 2019-02
-
Team:Science User Interface
Description
To make sure we do not serve bad HiPS data do the following:
- Check the return https status of the server. This is really the cause of the problem. The server returned a bad status and saved the html as the properties file.
- Validate the file:
- HiPS property are just like java property files.
- Use magic number for png and jpg
- Hard to validate table files so don't try. If we are not sure of the type don't try to validate.
- Tweek the cacheing parameters. See suggestions from Loi
Cache suggestions from Loi:
According to my reading, in order to do what we want, you want to include these headers in your response:
Cache-Control: must-revalidate max-age=1800 // good for 30mins.. then check for freshness.
Last-Modified: Wed, 21 Oct 2015 07:28:00 GMT // example of last modified date of the file served
To validate:
Get the header 'If-Modified-Since’ from the request, then only return the content/body when the content has changed.
Otherwise, return 304.
This check can come in as a ‘HEAD’ or a ‘GET’ request. So, to be safe, override doHead to point to processRequest() to cover all bases.
N.B.: This ticket was triggered based on this IRSA ticket: IRSA-2550
Attachments
Issue Links
- links to
A couple more things.
You may want to return the mentioned headers even when it hasn't been modified (304). This may extend the freshness of the cached item. (need to verify)
Also, doHead() should return only headers. So, make sure it's not sending the body.