alan-turing-institute / WimbledonPlanner

Project planning for REG
MIT License
0 stars 0 forks source link

Download end point on web-site #35

Closed jack89roberts closed 5 years ago

jack89roberts commented 5 years ago

The download link on the web-site was giving an error. I updated versions of the pdf conversion tool (wkhtmltopdf) in the web-app, and the expected zip file is now returned but the cropping of the pdf page doesn't seem to be working for the horizontal axis for some reason. Chrome also seems to do some kind of caching which means you get an older version of the files (you can tell something's wrong if you instantly get delivered the zip, as it should take some time to do the file conversion etc. in the background). On Safari this doesn't seem to happen.

For me everything works as expected if I run normally on my laptop, but I get the cropping issue if I run it in docker on a VM locally (or on Azure).

martintoreilly commented 5 years ago

It's possible to set your http headers to control caching (including saying not to cache at all). I expect flask exposes a way to set this for a function called on a particular route.

jack89roberts commented 5 years ago

PDF cropping issue was tricky to track down:

NB: Even though caching disabled the download end-point should now deliver the zip file ~immediately. This is because the pdfs and zip are generated as part of the update end-point now, rather than in the download end-point.

jack89roberts commented 5 years ago

Working after the changes above.