Results 1 to 6 of 6

Thread: Cache page in background?

  1. #1
    Join Date
    Sep 2012
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cache page in background?

    I am making a page for our alliance in a game http://fukabam.com But I have 2 smaller issues I would like to ask for help on.

    1. When the index page loads up, sometimes it is a little too fast running the script that creates the grey box around the text/banners, ending up with the lower KoC banner down in the black area instead of inside the box. Is it possible to cache that banner so its loaded in memory before the js script pushes it out?

    2. Click on the "Members" button, this page loads an external page, that works very slow because it gets information from inside of the game, is there any possible way to cache this site, maybe in the background once people are on our page, or by a script that runs on every visit, and perhaps holds an older version of the kocmon page? (we dont need it to be the "real" page, because that page is on a delay of its own and not 100% accurate anyway)

  2. #2
    Join Date
    May 2012
    Location
    Hitchhiking the Galaxy
    Posts
    1,013
    Thanks
    46
    Thanked 139 Times in 139 Posts
    Blog Entries
    1

    Default

    for the first one, try triggering the gray borders script onload for the banner.
    "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." - Linus Torvalds
    Anime Views Forums
    Bernie

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The only thing I can think of for that would be to have an iframe on the page. Give it style, dimensions like width: 1px; height: 1px; and visibility: hidden;. Make it's src attribute the page that you want to preload.
    Last edited by jscheuer1; 09-26-2012 at 08:04 AM. Reason: simplify
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Quote Originally Posted by jscheuer1 View Post
    The only thing I can think of for that would be to have an iframe on the page.
    Yes, something like this:
    Code:
    <iframe name="preload" style="position: absolute; display: none; left: -10000px" onload="if(frames.preload.location.href!='about:blank'){parent.location.href=frames.preload.location.href}"></iframe>
    <a href="javascript: void(0)" onclick="frames.preload.location.replace('some_page.html'); return false">go to some page.html</a>
    Works only for pages belonging to your own domain.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'd go for something more straightforward, like:

    Code:
    <iframe name="preload" style="position: absolute; visibility: hidden; left: -10000px;" src="pagetopreload.htm"></iframe>
    I'd use visibility: hidden; instead of display: none; because that's more likely to allow full preloading of the page.

    And doing it with the src attribute already set allows you to preload a page from any domain as long as it doesn't break out of or deny display in frames.
    Last edited by jscheuer1; 09-24-2012 at 12:27 AM. Reason: simplify, get specific
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    Quote Originally Posted by jscheuer1 View Post
    I'd go for something more straightforward, like:
    Code:
    <iframe name="preload" style="position: absolute; visibility: hidden; left: -10000px;" src="pagetopreload.htm"></iframe>
    Yes, but that I was thinking of a general way of preloading any 'non-foreign page' by clicking on a link of the navigation menu.
    I agree on what you say about visibility.
    Arie.

Similar Threads

  1. Page preload (cache)
    By molendijk in forum Looking for such a script or service
    Replies: 0
    Last Post: 04-09-2012, 07:15 PM
  2. Replies: 1
    Last Post: 08-03-2007, 01:20 PM
  3. Cache Update After Page Load
    By hikerguy1900 in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 10-30-2006, 01:38 AM
  4. How do I clear cache of page JPG files?
    By Strangeplant in forum HTML
    Replies: 3
    Last Post: 06-13-2006, 12:57 PM
  5. Reload external page in frame, no-cache?
    By KE5EHI in forum JavaScript
    Replies: 14
    Last Post: 12-28-2005, 01:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •