Context: I'm going to explain the context of this question, but I think that the answer to the question is not very context specific.
I have a background page in chrome a chrome extension. The page does the following:
chrome.commands.onCommand.addListener(function(){
chrome.windows.create({
url:"page.html",
type:'popup'
});
});
As you can see this creates a new window loading the page.html file from within my extension, when the user triggers the command (by using a hotkey).
The page page.html is a fairly heavy page. It runs a bunch of scripts (all from the extension directory) and a bunch of images (also all from the extension directory).
Punchline of context: The important thing here, is that the page is loading entirely locally. Nothing (until user input) calls out to the internet and it loads just fine when I am offline.
Question:
- When I load the window by triggering the event, as described above, it takes some time to load, lets say maybe 1.5 seconds. If I then refresh the new window (page.html), it loads in less than .5 seconds. What is causing this difference in time?
- How could I capitalize on the faster refresh rate to make my initial page load faster? Could I load a hidden version somehow? Or prerender it somehow? Any suggestions would be appreciated.