[Building Sakai] Loading PDFs in Chrome

Matthew Jones matthew at longsight.com
Thu Dec 11 08:59:37 PST 2014


Yeah, was looking at this today but haven't tested anything. Was reported
by Murcia as a possible Chome bug at

https://code.google.com/p/chromium/issues/detail?id=437738
And another source at
https://code.google.com/p/chromium/issues/detail?id=437648

This feature was originally contributed on
https://jira.sakaiproject.org/browse/KNL-215 and it says it pulls out of
DefaultServlet.java.

Looking at a more current source of this at
http://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java

It has a block like the below which includes ETag and Last-Modified
headers. One of both of these seems like it could help out having to
re-retrieve the document and mess it up. Not worth having everyone work on
fixing this though, but it *seems* like it's something Chrome isn't going
to fix from the comments.

                if (useAcceptRanges) {
                    // Accept ranges header
                    response.setHeader("Accept-Ranges", "bytes");
                }

                // Parse range specifier
                ranges = parseRange(request, response, resource);

                // ETag header
                response.setHeader("ETag", eTag);

                // Last-Modified header
                response.setHeader("Last-Modified", lastModifiedHttp);


On Thu, Dec 11, 2014 at 11:36 AM, Matthew Buckett <
matthew.buckett at it.ox.ac.uk> wrote:

> 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". I've uploaded an example
> to:
>
> https://qa10.longsight.com/access/content/public/Google.pdf
>
> which exhibits this problem. Uploading to a non Sakai webserver
> results in the file working correctly:
>
> http://users.ox.ac.uk/~buckett/Google.pdf
>
> If you open developer tools and disable the cache then it loads
> correctly every time. I'm running Chrome 39 and it also happens on
> Chrome Canary 41. I found an old copy of Chrome 37 in a VM and
> everything works correctly there between reloads. My guess is that
> Chrome 38 was also OK, but I don't have a copy to test with.
>
> 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?
>
> --
>   Matthew Buckett, VLE Developer, IT Services, University of Oxford
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20141211/a6e87c5e/attachment.html 


More information about the sakai-dev mailing list