Caching Web Pages?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Caching Web Pages?

  1. #1
    Brian Guest

    Caching Web Pages?


    How can I cache a web page without navigating to that page. We would like
    to preload the web pages, and rich media on to a computer without actually
    having to visit it.

    Please assist me with this question, we would like create this as a java
    applet.

    The purpose is to help speed up navigation of the internet.

  2. #2
    Andy Beaulieu Guest

    Re: Caching Web Pages?


    Why use a java crapplet to increase speed? (starting the java runtime in a
    browser is like crank-starting a 1930s tractor)...

    Instead, you could create hidden frame(s) and set their source to the pages
    you want to cache.

    Another more popular approach is to simply cache images (since these are
    by far the bulk of most pages) by creating an array of images in javascript.

    HTH,
    Andy




    "Brian" <brianwilliams03@hotmail.com> wrote:
    >
    >How can I cache a web page without navigating to that page. We would like
    >to preload the web pages, and rich media on to a computer without actually
    >having to visit it.
    >
    >Please assist me with this question, we would like create this as a java
    >applet.
    >
    >The purpose is to help speed up navigation of the internet.



  3. #3
    Gene Guest

    Re: Caching Web Pages?


    Brian-
    I have, actually, just finished what I would call 'the ultimate preloader'.
    It pre-caches the entire page while you see a 'loading' page, and when done,
    you are automatically forwarded to the pre-cached page. You could make the
    loading page into a page that is useful to look at, as well. Anyway, here
    is a complete description of how this is done:

    **************
    Choose a page to be preloaded. Mine was my index.htm, so I made a copy called
    indexpl(for preloader). I then made another page to be the 'loading' page,
    and called it loader.htm.


    In the <head> tags of the loader page, I put the following code:

    <SCRIPT LANGUAGE="JavaScript">
    function windowOpener()
    {
    controlWindow=window.open("indexpl.htm","","toolbar=no,location=no,directories=no,status=n o,menubar=no,scrollbars=no,resizable=no,width=45,height=45");
    self.focus();
    }
    </SCRIPT>

    Then, I included the following at the end of the <body> tag:

    onLoad="windowOpener();"

    Then put an image that said loading, and an estimated time.


    In indexpl.htm, you need this script in-between the <head> tags:

    <SCRIPT LANGUAGE = "JavaScript">
    <!--
    function get(url)
    {
    opener.location = url;
    }
    //-->
    </SCRIPT>

    And this in the <body> tag:

    onLoad="get('index.htm'); self.close();"

    Keep in mind that this page is an exact duplicate of index.htm, except for
    the extra JavaScript code. So now, when this 'clone' page finishes loading,
    it makes its 'opener' (the loader page) go to the actual index.htm, and closes
    itself.
    I used this actual code on a web site which is currently in development,
    and you can take a look if you wish at http://www.visgenwc.com . Please,
    though, use only the code I've told you about here on your own site. (Even
    though I will most likely be more than happy to give you permission to use
    more if you e-mail me about it. Thanks.)

    -Gene


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center