q - loading js file into cache

Discussion in 'Javascript' started by aum, Sep 22, 2006.

  1. aum

    aum Guest

    Hi,

    What's the simplest way to fetch a js file from the current website, then
    cache it?

    I'm using dojo, which has a large js file when using the built version.
    As a mercy for dialup users, I want to serve up a tiny 'loader' html page
    (containing an animated 'loading...' gif) which, when loaded:

    1. retrieves the big js file, and plants it in the cache
    2. when the js file is retrieved, then sets document.location to
    the url of the real website page which uses this js file, and
    thus redirects to that page

    Cheers
    aum
     
    aum, Sep 22, 2006
    #1
    1. Advertising

  2. aum

    aum Guest

    On Fri, 22 Sep 2006 16:27:12 +1200, aum wrote:
    > What's the simplest way to fetch a js file from the current website, then
    > cache it?


    Seems I've answered my own question.

    What's working for me is to insert, just before the final </html>
    at the end, the lines:

    <script type="text/javascript" src="path/to/big/js/file.js"></script>
    <script type="text/javascript">
    document.location = "next-page.html";
    </script>

    Cheers
    aum
     
    aum, Sep 22, 2006
    #2
    1. Advertising

  3. aum

    Vicky Guest

    Yes you r right, Gmail is also doing such thing...

    aum wrote:

    > On Fri, 22 Sep 2006 16:27:12 +1200, aum wrote:
    > > What's the simplest way to fetch a js file from the current website, then
    > > cache it?

    >
    > Seems I've answered my own question.
    >
    > What's working for me is to insert, just before the final </html>
    > at the end, the lines:
    >
    > <script type="text/javascript" src="path/to/big/js/file.js"></script>
    > <script type="text/javascript">
    > document.location = "next-page.html";
    > </script>
    >
    > Cheers
    > aum
     
    Vicky, Sep 22, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Nokes

    Cache::Cache Stale Segments

    Jeff Nokes, Sep 30, 2003, in forum: Perl
    Replies:
    0
    Views:
    610
    Jeff Nokes
    Sep 30, 2003
  2. DesignerX

    Page.Cache vs HttpContext.Current.Cache

    DesignerX, Jan 20, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    8,345
    vMike
    Jan 20, 2004
  3. =?Utf-8?B?b25l?=
    Replies:
    1
    Views:
    5,352
    Karl Seguin [MVP]
    Mar 8, 2006
  4. Sergey via DotNetMonster.com

    ASP.NET Cache vs Window System Cache

    Sergey via DotNetMonster.com, Nov 15, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    507
    Sergey via DotNetMonster.com
    Nov 15, 2006
  5. John
    Replies:
    2
    Views:
    1,219
Loading...

Share This Page