MyBB Internal: One or more warnings occured. Please contact your administrator for assistance.
Challenge: Use redirect pages to pre-load Javascript?
Current time: 01-19-2021, 01:47 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Challenge: Use redirect pages to pre-load Javascript?
04-01-2011, 10:48 PM (This post was last modified: 04-01-2011 11:01 PM by jesper_mortensen.)
Post: #1
Rainbow Challenge: Use redirect pages to pre-load Javascript?
Dear all,

While thinking about our URL structure, I came up with an idea. But I don't know whether this is feasible or not, and would very much welcome feedback here.

We have a couple of URLs which already must issue HTTP redirects. For example, our root folder http://company.com issues an HTTP redirect based on the user's language preference to f.x. http://company.com/en/ .

I thought, can these redirects serve a dual purpose by pre-loading or priming the browser cache with cache-able objects needed on the subsequent pages?

As an example, we load jQuery from the Google CDN on all our pages. Is there a way to make the browser cache jQuery while it's being redirected?

I can think of a couple of ways to do this with Javascript. However:
  1. I would insist on a solution which also works for those mobile browsers and search engine spiders that don't understand Javascript.
  2. If I load one "empty" HTML page which preloads JS and redirects to the proper page while blocking the redirect until the JS has loaded, then the overall page load speed for the content page doesn't improve -- it probably even gets worse.
Should an HTTP 302 redirect header with a HTML body with regular script tags work, or is the combination of a redirect header and a content body pure nonsense?

Should an empty HTML page with a few SCRIPT tags in the BODY and a META REFRESH work?

Any suggestions, any insights, does this seem sensible or not? Smile Thanks,
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Challenge: Use redirect pages to pre-load Javascript? - jesper_mortensen - 04-01-2011 10:48 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)