You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a URL like https://via.hypothes.is/https://example.com/foo.pdf calls the proxy() view, the view:
Determines whether https://example.com/foo.pdf is HTML or PDF (by making a GET request to https://example.com/foo.pdf and looking at the Content-Type)
Renders an <iframe> whose src is either https://via.hypothes.is/pdf?url=https://example.com/foo.pdf (which goes to the view_pdf() view) or https://viahtml.hypothes.is/proxy/https://example.com/foo.pdf depending on whether https://example.com/foo.pdf is a PDF or not
This causes the browser to make an extra network round trip to get the <iframe>'s src URL.
In the case of PDFs this extra network round trip could be avoided: the proxy() view could just return the PDF.js response (as would be returned by the view_pdf() view) directly.
In the case of HTML the proxy() view does still need to return an <iframe> since HTML is handled by a separate app.
The text was updated successfully, but these errors were encountered:
When a URL like
https://via.hypothes.is/https://example.com/foo.pdf
calls theproxy()
view, the view:https://example.com/foo.pdf
is HTML or PDF (by making aGET
request tohttps://example.com/foo.pdf
and looking at theContent-Type
)<iframe>
whosesrc
is eitherhttps://via.hypothes.is/pdf?url=https://example.com/foo.pdf
(which goes to theview_pdf()
view) orhttps://viahtml.hypothes.is/proxy/https://example.com/foo.pdf
depending on whetherhttps://example.com/foo.pdf
is a PDF or notThis causes the browser to make an extra network round trip to get the
<iframe>
'ssrc
URL.In the case of PDFs this extra network round trip could be avoided: the
proxy()
view could just return the PDF.js response (as would be returned by theview_pdf()
view) directly.In the case of HTML the
proxy()
view does still need to return an<iframe>
since HTML is handled by a separate app.The text was updated successfully, but these errors were encountered: