Possible to avoid refreshing?

THE TOUCHTHE TOUCH Registered Users Posts: 535 Major grins
edited July 24, 2006 in Mind Your Own Business
Hope this is the right thread.

I have done some searching, and checked my Dreamweaver books with no luck. :dunno

I change the picture on my homepage weekly but when I go to view the updated page, I have to refresh in order for it to change. I'm assuming those that frequently visit the site would have to do the same. Problem obviously applies to all site changes, not just pictures.

Is there a way to avoid the need to refresh? Thanks!:thumb
Insanity: Doing the same thing over and over again and expecting different results. - Albert Einstein :bash

- Kevin

Comments

  • Shay StephensShay Stephens Registered Users Posts: 3,165 Major grins
    edited July 16, 2006
    THE TOUCH wrote:
    Hope this is the right thread.

    I have done some searching, and checked my Dreamweaver books with no luck. <img src="https://us.v-cdn.net/6029383/emoji/ne_nau.gif&quot; border="0" alt="" >

    I change the picture on my homepage weekly but when I go to view the updated page, I have to refresh in order for it to change. I'm assuming those that frequently visit the site would have to do the same. Problem obviously applies to all site changes, not just pictures.

    Is there a way to avoid the need to refresh? Thanks!<img src="https://us.v-cdn.net/6029383/emoji/thumb.gif&quot; border="0" alt="" >
    Yes, give the image a new name each time you post a new photo. If that is not possible, then try appending some random data to it to make it look unique (e.g. path/image.jpg?123456) where 123456 is a randomly generated number that changes when the image changes.

    Another possibility, though not recommended is to turn off the cache for the page:
    [FONT=Courier New]< meta  http-equiv="pragma" content="no-cache">[/FONT]
    
    Creator of Dgrin's "Last Photographer Standing" contest
    "Failure is feedback. And feedback is the breakfast of champions." - fortune cookie
  • THE TOUCHTHE TOUCH Registered Users Posts: 535 Major grins
    edited July 16, 2006
    Shay - Thank you for the info. Each time I change the image, it does have a new image name but I still need to refresh.

    You mentioned turning off the cache - why is it not recommended? Is this something I do in my webpage software?

    Thanks again!
    Yes, give the image a new name each time you post a new photo. If that is not possible, then try appending some random data to it to make it look unique (e.g. path/image.jpg?123456) where 123456 is a randomly generated number that changes when the image changes.

    Another possibility, though not recommended is to turn off the cache for the page:
    [FONT=Courier New]< meta  http-equiv="pragma" content="no-cache">[/FONT]
    
    Insanity: Doing the same thing over and over again and expecting different results. - Albert Einstein :bash

    - Kevin
  • THE TOUCHTHE TOUCH Registered Users Posts: 535 Major grins
    edited July 16, 2006
    I took a look at the webpage from my wife's computer and it loaded just fine - no need to refresh.

    What's the difference between her computer and mine? ne_nau.gif
    Insanity: Doing the same thing over and over again and expecting different results. - Albert Einstein :bash

    - Kevin
  • Shay StephensShay Stephens Registered Users Posts: 3,165 Major grins
    edited July 16, 2006
    THE TOUCH wrote:
    I took a look at the webpage from my wife's computer and it loaded just fine - no need to refresh.

    What's the difference between her computer and mine? ne_nau.gif

    Hmm, you could be experiencing a settings difference between the two browsers. If memory serves, IE has a setting for controlling how the cache works. It's in the preferences, but I don't remember where at this point.
    Creator of Dgrin's "Last Photographer Standing" contest
    "Failure is feedback. And feedback is the breakfast of champions." - fortune cookie
  • AndyAndy Registered Users Posts: 50,016 Major grins
    edited July 16, 2006
    Or, you could just make a homepage slide show, duration of slides really long, and the gallery from which the slideshow comes is sorted by most recently uploaded?

    http://www.dgrin.com/showthread.php?t=28348
  • THE TOUCHTHE TOUCH Registered Users Posts: 535 Major grins
    edited July 16, 2006
    Andy wrote:
    Or, you could just make a homepage slide show, duration of slides really long, and the gallery from which the slideshow comes is sorted by most recently uploaded?

    http://www.dgrin.com/showthread.php?t=28348

    Thanks Andy...But I think we went through this already...

    http://www.dgrin.com/showthread.php?t=37499

    My homepage is through my own server, not SmugMug. thumb.gif
    Insanity: Doing the same thing over and over again and expecting different results. - Albert Einstein :bash

    - Kevin
  • AndyAndy Registered Users Posts: 50,016 Major grins
    edited July 16, 2006
    THE TOUCH wrote:
    Thanks Andy...But I think we went through this already...

    http://www.dgrin.com/showthread.php?t=37499

    My homepage is through my own server, not SmugMug. thumb.gif
    Sorry.
  • THE TOUCHTHE TOUCH Registered Users Posts: 535 Major grins
    edited July 16, 2006
    Andy wrote:
    Sorry.

    That's okay...Thanks for the info!
    Insanity: Doing the same thing over and over again and expecting different results. - Albert Einstein :bash

    - Kevin
  • trogloditetroglodite Registered Users Posts: 130 Major grins
    edited July 17, 2006
    There is a setting in IE
    tools > general > settings
    check "check for new page 'Every visit to the page'"

    What happens is IE stores your old image and such and doesn't look for new content. Caching a ton of web stuff is bad, it fragments your drive. The cache really shouldn't be over 1mb, and mine is completely off 0mb. This forces the browser to pull new images and if you have dsl or better, who cares?

    The real problem is that most people have this setting on as default ... sooooo... you'll have to rename the image.

    You could also have write a bit of javascript to pull a different image each time the page loads. Then you could just add to and subtract to the images as you go along. Basically setting a bunch of images to an array and randomly picking an image from the array.

    You might be able to bypass this with a bit of javascript though you would have to try it out to see if it works with caching on....

    something to the effect of calling out the image in head with script - which is done with rollovers so there is no delay when you move your mouse over. something like

    if(document.images){
    firstImage = new Image;
    secondImage = new Image;

    firstImage = "images/firstheader.jpg";
    secondImage = "images/secondheader.jpg";
    }

    This is only a piece of what you would use for the rollover but it accomplishes the preloading of the image. Basically javascript is executed by the browser after the page has been loaded so I would think it would load the new image in the cache but I could be wrong... I'll have to play around and see.
    is now gone. i have no time for cliques and fan clubs.
  • trogloditetroglodite Registered Users Posts: 130 Major grins
    edited July 17, 2006
    THE TOUCH wrote:
    I took a look at the webpage from my wife's computer and it loaded just fine - no need to refresh.

    What's the difference between her computer and mine? ne_nau.gif

    it could be that your site wasn't stored in the cache or it was but there were too many sites looked at since you viewed it last so that your old cached site was 'bumped off' for more recent sites that are cached.
    is now gone. i have no time for cliques and fan clubs.
  • THE TOUCHTHE TOUCH Registered Users Posts: 535 Major grins
    edited July 17, 2006
    troglodite wrote:
    it could be that your site wasn't stored in the cache or it was but there were too many sites looked at since you viewed it last so that your old cached site was 'bumped off' for more recent sites that are cached.

    So as long as I do a new filename every time I put up a new picture, it should update when people come back to the site...correct? At least most of the time?

    Thanks!
    Insanity: Doing the same thing over and over again and expecting different results. - Albert Einstein :bash

    - Kevin
  • trogloditetroglodite Registered Users Posts: 130 Major grins
    edited July 24, 2006
    It would be a good start. If the browser requests the new image/filename from it's cache and it's not there it will download a new one. So - hopefully!
    is now gone. i have no time for cliques and fan clubs.
  • THE TOUCHTHE TOUCH Registered Users Posts: 535 Major grins
    edited July 24, 2006
    Thanks!
    troglodite wrote:
    It would be a good start. If the browser requests the new image/filename from it's cache and it's not there it will download a new one. So - hopefully!
    Insanity: Doing the same thing over and over again and expecting different results. - Albert Einstein :bash

    - Kevin
Sign In or Register to comment.