The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

2 Pages V  1 2 >  
Reply to this topicStart new topic
> Page refreshing problem
Decky
post Aug 6 2017, 06:43 PM
Post #1


Newbie
*

Group: Members
Posts: 14
Joined: 5-August 17
Member No.: 26,472



My association website (http://www.nhoa.org.uk/) has pages that often need to be updated so that members can view the latest information (such as news and events). The problem is that members are still seeing the old page cached by the browser and don't realise that the page has been updated with new information. The address has web forwarding to the server at http://www.nhoa.hyperphp.com/home.html so even if they do refresh the page, with http://www.nhoa.org.uk/ in the address bar it always takes the reader back to the homepage without refreshing the page that was being read. To try and overcome this I've added a direct link under the menu to take the reader the server address so that pressing F5 refreshes the page being read without jumping to the homepage. This is far from ideal as members don't know when to click on the direct link and continue viewing the old cached data.

I need to implement a command in the coding to automatically refresh the page from the server address. I've been experimenting with <meta http-equiv="refresh" content="30"> but can't get it to work properly. If I set the content to "30" it waits 30 seconds before it's refreshed and the reader could have read the old data and gone by then. If I set it to less than that, say 10 seconds, it makes reading very difficult if they have a slow connection and the page keeps going off to reload every 10 seconds.

I ideally need something that will either force the browser to load the page from the server and not the cache (overriding the browser settings) or refresh the page once as soon as it has been loaded (or after a predetermined time) and then stop. Any suggests for achieving this will be greatly appreciated (I've done numerous searches online but everything seems to point to the above meta tag solution).

This post has been edited by Decky: Aug 6 2017, 06:59 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 6 2017, 06:59 PM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



There are server-side ways to control caching, but I'm afraid that's not my forte. Do you have the impression this caching problem affects a lot of people? Do you see it yourself? If not, it could be that the users that have the problem have set their browsers to always cache.

QUOTE
The address has web forwarding to the server at http://www.nhoa.hyperphp.com/home.html so even if they do refresh the page, with http://www.nhoa.org.uk/ in the address bar it always takes the reader back to the homepage without refreshing the page that was being read


This sounds strange though. While frames are inherently evil and I strongly recommend that you stop using cloaking and either host the domain properly or use the real URL, this isn't normal behaviour. I've never seen a browser do this, not that I can recall. When refreshing the frameset with the currently loaded pages should reload and that's also what happens for me at your site.

But whatever you do, don't use Meta refresh. It will annoy the h*ll out of everyone. wink.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Decky
post Aug 6 2017, 07:24 PM
Post #3


Newbie
*

Group: Members
Posts: 14
Joined: 5-August 17
Member No.: 26,472



Thanks Pandy. Yes it's a common problem and the majority of members aren't very computer literate. It has arisen again today with the Chairman unable to view a new page, hence me trying to resolve the problem again. The direct link didn't work for him so I'm having to try and explain to him how to delete his browser temp files. I also have the same problem when updating a page and I always have to refresh the direct link to check the published updates. When I added the new page I also couldn't see it online using Chrome, the direct refresh didn't work either and I had to delete the temp files before it would show.

I purchased the www.nhoa.org.uk/ address from 123-Reg over 10 years ago, it has been widely published and is well known to members so cannot be changed now. I don't know of a better way of setting it up using this address such that members don't get confused with another address appearing in the address bar. Is there a better way than cloaking? Any suggestions will be welcome.

When you tried reloading it were you viewing the homepage at http://www.nhoa.org.uk/? See what happens when you go to another page in the menu and then refresh it.

This post has been edited by Decky: Aug 6 2017, 07:34 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Aug 6 2017, 08:01 PM
Post #4


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



Well, when I write code to make an AJAX call I always include a query string with the time as the parameter. My hope is that this prevents cache problems.

Maybe you can add a 'time=' query string to the URL?

This post has been edited by CharlesEF: Aug 6 2017, 08:02 PM
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 6 2017, 09:59 PM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



I already tried several pages. The same page reloaded when I refreshed.

The proper way to do it is to use a host where you can use your domain name as it's meant to be used. That is, from your registrar you point your domain to your hosts name servers. This is very easy. You get the names or IP addresses from your host and enter them in a form at your registrar. After a very short delay these days everything will work and you will be taken to your index file at your host when you type your domain name in the address bar.

This is how it works with paid hosts. There are some free hosts that offer domain hosting, but most don't. If I understand it right your current host offer domain hosting even with free accounts if I understand the spec right. The Learn More link doesn't work so...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Decky
post Aug 7 2017, 06:11 AM
Post #6


Newbie
*

Group: Members
Posts: 14
Joined: 5-August 17
Member No.: 26,472



Thanks Charles EF, I've never added a time query string in the URL. How does that work if I've published a domain name that people use?

Thanks Pandy but from what you're saying I'm sure that's how it works now. I bought the domain name from 123-Reg and in their control panel I point it to the server address at hyperphp.com. Its set up for framed web forwarding so that the user won't be confused by the change of address in the address bar. Maybe I shouldn't worry about that but if I use non-framed web forwarding will it overcome the problem without users having to manually refresh the page?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 7 2017, 07:01 AM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



QUOTE(Decky @ Aug 7 2017, 01:11 PM) *

Thanks Charles EF, I've never added a time query string in the URL. How does that work if I've published a domain name that people use?


You have only published the URL to the homepage, so to speak, haven't you, http://www.nhoa.org.uk/ ? So if you change internal URLs it won't affect that.

QUOTE
Thanks Pandy but from what you're saying I'm sure that's how it works now. I bought the domain name from 123-Reg and in their control panel I point it to the server address at hyperphp.com. Its set up for framed web forwarding so that the user won't be confused by the change of address in the address bar. Maybe I shouldn't worry about that but if I use non-framed web forwarding will it overcome the problem without users having to manually refresh the page?


No, it's not. I don't know if it's still the correct term, but you are using cloaked redirection. I.e. your domain still points at your registrar. They load a html page with a frameset with a single frame in which http://www.nhoa.hyperphp.com/home.html is loaded.

Registrars often offer this as one of several options. If you can use your own domain with the hosting account you have now, find out what nameservers you should use (they are usually two but it can be more). It can be numeric addresses or URLs like ns1.example.com and ns2.example.com. Then you go to your registrar, delete the cloaking and enter the nameservers in the appropriate fields instead.

After a while your domain will stop working. But that's only temporary. It used to be that it could take up to two days for a domain to propagate as it's called, but nowadays it's usually much faster, a matter of an hour or two. Then people will see the real URLs, but at your domain this time, will be able to link to specific pages, bookmark them and so on.

Name servers are thingamajigs that translate domain names to IP addresses and they are all over the place. Hosts have theirs. Your internet provider have theirs and mine have theirs. Routers along the way have theirs. All these name servers around the world need to update their lists to make your domain lead to your account at your host. That's why it isn't instant.

I'd start with this. Maybe it will solve your current problem, maybe it won't. But it will solve a whole lot of problems caused by frames either way.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 7 2017, 07:35 AM
Post #8


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



QUOTE(Decky @ Aug 7 2017, 01:43 AM) *

My association website (http://www.nhoa.org.uk/)

That server didn't respond until my third attempt. A paid host should be more reliable.

QUOTE
The address has web forwarding to the server at http://www.nhoa.hyperphp.com/home.html

Not sure what's going on there. That page requires both javascript and cookies (not recommended). When I enable javascript it redirects to http://www.nhoa.hyperphp.com/home.html?i=1 and shows a complete web page, but without javascript even home.html?i=1 just shows the NOSCRIPT message. Is some server-side scripting involved here, or is it just javascript encyption (I didn't investigate the aes.js file closely)?

Maybe all this somehow contributes to the caching problem.

QUOTE
so even if they do refresh the page, with http://www.nhoa.org.uk/ in the address bar it always takes the reader back to the homepage without refreshing the page that was being read.

Do you mean the user tries to reload a framed page other than the frameset's default, but when the whole frameset is reloaded they're taken back to default frame page? That's normal for framesets, unless you right-click in the frame and choose "reload framed page"(in browsers that support that).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 7 2017, 07:41 AM
Post #9


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



I think he means the frameset is reloaded with home.html in the frame instead of with the page you were viewing before.

I don't follow what you say about JS. Works fine for me with JS off and the only occurrence of "script" I find in the source is an empty NOSCRIPT. unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 7 2017, 08:59 AM
Post #10


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Aug 7 2017, 02:41 PM) *

I don't follow what you say about JS. Works fine for me with JS off and the only occurrence of "script" I find in the source is an empty NOSCRIPT. unsure.gif

This what I get from http://www.nhoa.hyperphp.com/home.html when javascript and cookies are disabled:

CODE
<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("36e76c5e28e4c9b4b1b8e02a87483467");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://www.nhoa.hyperphp.com/home.html?i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Aug 7 2017, 10:48 AM
Post #11


Programming Fanatic
********

Group: Members
Posts: 1,981
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



QUOTE(Decky @ Aug 7 2017, 06:11 AM) *

Thanks Charles EF, I've never added a time query string in the URL. How does that work if I've published a domain name that people use?
Here is the basic structure
CODE
http://www.nhoa.hyperphp.com/home.html?x=15896522354825
I used 'x=' because time might not work correctly for you, only a 24 hour clock. It would be better to use random numbers instead. You will need Javascript or a server side language, like PHP, to generate the random numbers and place it in the query string.

My theory is that when a URL is different you shouldn't have a cache problem.
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 7 2017, 06:22 PM
Post #12


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



QUOTE(Christian J @ Aug 7 2017, 03:59 PM) *

This what I get from http://www.nhoa.hyperphp.com/home.html when javascript and cookies are disabled:

And I get the same source and the page looks the same either JS is on or off. wacko.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 7 2017, 06:33 PM
Post #13


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



Must be something wrong with your browser's JS toggling. Try viewing the page from http://www.rexswain.com/httpview.html (I get the JS from there too).

Wonder how the page is created. It seems to set a javascript cookie using JS-based AES encryption, but I don't know where the HTML comes from (maybe it's Ajax, but it also redirects to http://www.nhoa.hyperphp.com/home.html?i=1 --so maybe a server-side script checks if the cookie exists at that stage and only then outputs HTML).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 7 2017, 06:56 PM
Post #14


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



No, it has always worked before. Must be something else. Maybe something the host is up to? The pages themselves seem like plain vanilla HTML. Peculiar.

It's peculiar to serve up JS (well, to some people) when JS isn't available and use no JS at all when it is.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 7 2017, 08:18 PM
Post #15


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



Did you load it first with JS, then without? If so, maybe the page set a cookie with javascript first time, and then reads that cookie with a server-side script on subsequent visits, even if you've disabled JS by then.

This assumes that JS is served when no cookie is present, and HTML when there is a cookie.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 7 2017, 08:25 PM
Post #16


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Yes, of course I did. Could be it. Still, must be server side and I have a feeling it's the host doing it. There is no JavaScript used in the pages I looked at, just that empty NOSCRIPT.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 7 2017, 08:30 PM
Post #17


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Yes, you guessed right, I think. JS off and cookies deleted and I also get the stupid message.

Decky, do you have a free or paid account at that host? If free, have they at any point forced ads?

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Decky
post Aug 7 2017, 10:07 PM
Post #18


Newbie
*

Group: Members
Posts: 14
Joined: 5-August 17
Member No.: 26,472



Goodness me there's a lot more going on here than I was ever aware of, thanks ever so much everyone for all the help.

I see about changing the internal URL, I could amend the address in the 123-reg panel that points to the server, I never thought of that. Thanks for the structure CharlesEF.

Yes ChritianJ, when the user loads the frameset using nhoa.org.uk, refreshing it takes them back to the homepage. The direct link to the server I added to the page was a way of bypassing the frameset so that refreshing the page only affects the page being read. Users won't know about refreshing frames and pages and they won't know when they'll need to refresh the page anyway.

It's a free host account Pandy and they had no forced ads when I set it up initially (and was advertised as such). They introduced them later though, I complained and they they took them off in exchange for me putting a link to their website on every page.

On a different note, I tend to go for simple solutions and I introduced some JS code in the header and single automatic updates now work perfectly. Now when I upload an updated page to the server it appears as soon as I click on the menu button again without having to refresh the page or delete any temp files. This should propagate out to members as soon as the old pages get cleared from their caches. The code modifies the URL in the address bar but it's invisible because it's cloaked and only shows http://www.nhoa.org.uk/.

<script type="text/javascript">
window.onload = function() {
if(!window.location.hash) {
window.location = window.location + '#loaded';
window.location.reload();
}
}
</script>

It does the job smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Aug 8 2017, 07:11 AM
Post #19


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



OK, then I think it's your host that injects the JS crap. Their ads are probably JS dependent and they don't want anyone to miss them.

Theoretically it could also be your host that causes the caching problem. Pages can be cached on the server too, to preserve bandwidth I think. I don't know enough about this to find out if that's what's going on.

Maybe you should consider moving to another host? If you don't have many visitors a very small account (as accounts are usually huge today) would suffice and it shouldn't cost much at all. Then you would get rid of the JS and possibly the caching problem and fix the domain pointing all in one fell swoop.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Decky
post Aug 8 2017, 08:16 AM
Post #20


Newbie
*

Group: Members
Posts: 14
Joined: 5-August 17
Member No.: 26,472



Not sure if I follow Pandy, I don't have ads on the page any more, not for many years. I guess you mean that the JS could be a remnant from what the host put on in the old days.

I'm ok with the existing host, it's very reliable - I can't remember having any problems in the last 10 years (tempting fate) and the JS code I put on earlier (post #18) cures the caching problem. It may be plastering over the cracks but it does the job. I've removed the direct links to the server because the page won't need to be manually refreshed any more.

This post has been edited by Decky: Aug 8 2017, 08:19 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

2 Pages V  1 2 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th March 2024 - 12:54 AM