Skip to content
This repository has been archived by the owner on Sep 17, 2018. It is now read-only.

Commit

Permalink
Prefetch dialog components from the communication_iframe
Browse files Browse the repository at this point in the history
When the browser is idle, it will start fetching and caching the
dialog's Javascript, CSS and images. This works on IE9, Firefox
and Chromium.

The trick is to make sure that the communication iframe is open
while the user is busy reading the RP's site. When using the watch
API, this happens automatically at the end of the .watch() call.
  • Loading branch information
Francois Marier committed Nov 23, 2012
1 parent cdc6e5b commit fec9880
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions resources/views/communication_iframe.ejs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
<head><title>non-interactive iframe</title> <head><title>non-interactive iframe</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/> <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<meta charset="utf-8"> <meta charset="utf-8">
<%- cachify(util.format('/production/%s/dialog.js', locale), {tag_format: '<link rel="prefetch" href="%s">'}) %>
<%- cachify('/production/dialog.css', {tag_format: '<link rel="prefetch" href="%s">'}) %>
<%- cachify('/common/i/grain.png', {tag_format: '<link rel="prefetch" href="%s">'}) %>
<%- cachify('/dialog/i/persona-logo-transparent.png', {tag_format: '<link rel="prefetch" href="%s">'}) %>
<%- cachify('/dialog/i/arrow_grey.png', {tag_format: '<link rel="prefetch" href="%s">'}) %>
<%- cachify('/common/i/button-loader.gif', {tag_format: '<link rel="prefetch" href="%s">'}) %>
<%- cachify('/common/i/button-arrow.png', {tag_format: '<link rel="prefetch" href="%s">'}) %>
<%- cachify('/common/i/button-arrow-hover.png', {tag_format: '<link rel="prefetch" href="%s">'}) %>
<%- cachify('/common/i/button-arrow-active.png', {tag_format: '<link rel="prefetch" href="%s">'}) %>
<%- cachify_js('/production/communication_iframe.js') %> <%- cachify_js('/production/communication_iframe.js') %>
</head> </head>
<body></body> <body></body>
Expand Down

0 comments on commit fec9880

Please sign in to comment.