Page 1 of 1

Frequent page updates creates problems

Posted: Wed Mar 27, 2019 4:53 pm
by Trugmaker
There are millions of sites that change the content of certain pages very frequently - news - offers - images etc. etc. I have a problem that I cannot seem to correct. I have a news page and a results page that will only display correctly after deleting all browsing data. Well this is ok for me as I know to do this, but there are many regular visitors that do not know to do this so their webpage is either scrambled or not updated! I told one visitor to delete browsing data and his reply was - "no chance, I have to re-enter all my passwords if I do that". And I know he's right. How do websites avoid this situation so that when they update regular visitors are always up to date? A while ago the following was suggested by Pedro:-
You can add 'user defined' meta tags in the Page properties.
You will need to add the code to all pages that you do not want to cache.
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />

But this has not worked. It must be possible because as previously stated 'millions of sites change the content of certain pages very frequently'.

Re: Frequent page updates creates problems

Posted: Wed Mar 27, 2019 5:39 pm
by Pablo
Note that this is not specific to the application.
But this has worked for other users:

Code: Select all

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

Re: Frequent page updates creates problems

Posted: Wed Mar 27, 2019 5:50 pm
by Rob
Any chance at adding these options to the page properties within WB in a future update?
Also, did you get any feedback on how this affects page speed?

Re: Frequent page updates creates problems

Posted: Wed Mar 27, 2019 6:26 pm
by Pablo
These are not official HTML tags and also there is no guarentee that this will work so that is why they will not be added as standard options.

Re: Frequent page updates creates problems

Posted: Wed Mar 27, 2019 6:35 pm
by crispy68
Check with your hosting company. Many of them will cache information on the server for a period of time. I recently had this happen with godaddy.

There is code you can add to the .htaccess file to help with this as well.

Re: Frequent page updates creates problems

Posted: Thu May 02, 2019 3:05 pm
by Trugmaker
Almost there! The second code you gave worked like a dream (almost). It worked first time :D but when I made minor alterations minutes later, I again had to clear my browsing history before it was correct. I made changes again today (league updates)and once again it worked perfectly, but again when I made a small change to an incorrect entry, I once again had to clear history. So near!

Re: Frequent page updates creates problems

Posted: Thu May 02, 2019 3:30 pm
by alan_sh
I'd be interested to see if there's a solution for this too.

Alan

Re: Frequent page updates creates problems

Posted: Thu May 02, 2019 7:24 pm
by bkjohns
Trugmaker wrote:
Thu May 02, 2019 3:05 pm
Almost there! The second code you gave worked like a dream (almost). It worked first time :D but when I made minor alterations minutes later, I again had to clear my browsing history before it was correct. I made changes again today (league updates)and once again it worked perfectly, but again when I made a small change to an incorrect entry, I once again had to clear history. So near!
Why clear the entire cache? Won't a simple refresh of the page do it w/o resetting all stored info (p/w, user id, etc)?

Re: Frequent page updates creates problems

Posted: Thu May 02, 2019 9:34 pm
by Trugmaker
No, afraid I can refresh 10 times with no change, but as soon as I clear all browsing - all good. The problem I have is that as one member said "trouble is if I clear all browsing I have to re-enter all passwords for many sites, and I aint doing that".
As I have stated several times, there are many sites that change info/prices/figures etc on a daily basis, so the answer is there somewhere without a slowing down of pageloading.

Re: Frequent page updates creates problems

Posted: Thu May 02, 2019 10:14 pm
by crispy68
Did you check with your host as I stated before? Many servers cache info and there is code you can place in the .htaccess file to adjust what files, images, etc. are cached and for how long. This is done to speed up loading of your website.

Re: Frequent page updates creates problems

Posted: Thu May 02, 2019 10:40 pm
by BaconFries
As I have stated several times, there are many sites that change info/prices/figures etc on a daily basis, so the answer is there somewhere without a slowing down of pageloading.
Probably because they are using a (CDNs) Content Delivery Networks that allows them to purge the cache on the server frequently without any noticeable change to the end user. Have you read crispys reply regarding the use of a specific .htacess file set with rules for this?.

Using Apache .htaccess file:
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>
The above will only work if your host/server runs Apache.

You can also try php headers see the following reading from:
Example #2 Caching directives
https://www.php.net/manual/en/function.header.php
When using the above php headers your page extension should be .php
Note these are just examples on how to try and achieve with no help offered... sorry.

Re: Frequent page updates creates problems

Posted: Sat May 11, 2019 4:53 pm
by Trugmaker
Well this problem that has been driving me (and my Club web viewers) bleedin nuts, I may (fingers crossed) have found the answer??? I inserted the following into my .htaccess file:-

<FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|mp3|mp4|png|pdf|swf|txt)$">
<IfModule mod_expires.c>
ExpiresActive Off
</IfModule>
<IfModule mod_headers.c>
FileETag None
Header unset ETag
Header unset Pragma
Header unset Cache-Control
Header unset Last-Modified
Header set Pragma "no-cache"
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
</IfModule>
</FilesMatch>

I have tested it several times by making odd changes in several pages and so far it has worked like a dream - but maybe it's because the winds in the right direction and the wife's being nice to me - like the fix, it probably won't last!