Forum Moderators: open

Message Too Old, No Replies

Refresh on back page

         

giggle2

6:53 am on Nov 30, 2016 (gmt 0)

5+ Year Member



hi

Does anyone know of a way to force a page to reload if the user presses back page?

I've looked at various solutions via various Google searches but I cannot find a solution that works.

Some use cache control but I'm concerned that it might do something that Google doesn't like at ultimately effect our search position.

This is a real head-scratcher for me!

All the best

Mick

keyplyr

7:36 am on Nov 30, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Mick have you tried...?

<script language=javascript>window.history.go(-2);</script>

This works *most* of the time, for *most* browsers but you"ll never really be able to efficiently control cache. There are too many players... browser settings, server default, ISP, etc.

keyplyr

8:00 am on Nov 30, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<script>
if (document.referrer == "http://www.page2.html")
window.location.reload();
}
</script>

Add to head of your page 1.

lucy24

7:05 pm on Nov 30, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Huh. I do it with a <body onload blahblah> ... but it's still scripting. (Do you still need to specify script language? I thought it was one of those things like style type that's no longer really required.) Since the question was posted in the HTML subforum, I wondered if OP is looking for a specifically HTML-based solution. I'm inclined to think there ain't none, barring one of the many cache-based fixes. That, of course, isn't HTML either ;)

If you click Back, does the second page even get sent as referer? Why would it?

:: detour to test site ::

No, it's worse: If you click the back arrow--at least in Firefox--a new request isn't sent at all; it just loads up the page from the browser's cache. And that's on a site with caching explicitly set to "access".

birdbrain

11:53 pm on Nov 30, 2016 (gmt 0)



Hi giggle2,
why on earth would you want to mess with a site visitor's experience?

When I return to page from which I have navigated I expect to find
it exactly as I left it.

That is why it is named "Back button", if it didn't act as
described it would be named "Random Page button" or similar.

birdbrain

NickMNS

12:52 am on Dec 1, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Another caveat to consider is if your are using Adsense on these pages, the refresh will cause the ads to be reloaded which in turn will inflate your page views. Adsense may not appreciate you inflating your page views. Inflated page view may also been an issue in GA where it will bias your stats.

As birdbrain so eloquently asked, why? Specifically what do you want to refresh? Maybe there is another solution that will achieve what you want.