[Building Sakai] Loading PDFs in Chrome

Sam Ottenhoff ottenhoff at longsight.com
Thu Dec 11 08:57:06 PST 2014


> We've recently started seeing a problem with Google Chrome not
> displaying PDFs correctly. The first time you load a PDF it will
> display correctly, if you then refresh the browser it will display an
> error saying "Failed to load PDF Document".


It looks like some of our Spanish colleagues have already reported this:

  https://code.google.com/p/chromium/issues/detail?id=437738#c6.

One difference between the two webservers is that the working one
> generates ETags which Chrome uses when it loads the page a second
> time. Anyone got any ideas?
>

One other difference, your Apache HTTPD server returns "Accept-Ranges:
bytes" on a range request.  Sakai does not.

$ curl -I --header "Range: bytes=40000-"
http://users.ox.ac.uk/~buckett/Google.pdf


HTTP/1.1 206 Partial Content
Date: Thu, 11 Dec 2014 16:48:59 GMT
Server: Apache/2.2.3 (Debian)
Last-Modified: Thu, 11 Dec 2014 15:54:55 GMT
*ETag: "870009-14bc4-509f2cc20f1c0"*
*Accept-Ranges: bytes*
Content-Length: 44932
Content-Range: bytes 40000-84931/84932
Content-Type: application/pdf

$ curl -I --header "Range: bytes=40000-"
https://qa10.longsight.com/access/content/public/Google.pdf

HTTP/1.1 206 Partial Content
Server: nginx/1.6.2
Date: Thu, 11 Dec 2014 16:49:14 GMT
Content-Type: application/pdf
Content-Length: 44932
Connection: keep-alive
Set-Cookie: JSESSIONID=
b52ebba1-bf08-4d5b-b3bc-102f7aabbf7d.server59.longsightgroup.com; Path=/;
Secure; HttpOnly
X-UA-Compatible: IE=EmulateIE11
Content-Range: bytes 40000-84931/84932
*Content-Disposition: inline; filename="Google.pdf"*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20141211/1ca850dc/attachment.html 


More information about the sakai-dev mailing list