Forum Moderators: open
I'm about to build a flat site for a finance organisation. The home-page of this site needs to display their current interest rate for home loans.
Their site has high home-page traffic currently, and I believe this is because people are coming daily to check the interest rate. However they have had problems with this rate caching in people's browsers - therefore they fear they will either lose customers or be open to legal action if they appear to be displaying an untrue interest rate on their website.
I need to find a fail-safe method for ensuring that this interest rate is not cached in the visitors' browsers.
One idea I had so far was incorporating the following code into the head:
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
...however I've had problems with that code before (I use it on the schedule pages for a local cinema operator - yet they still constantly get calls from people who say the site is "displaying last week's data").
So, I thought that's a start but obviously isn't fail-safe.
Another idea I had was to auto-refresh the page every few seconds - however since it is the home page with lots of other information on it, this would be infuriating for visitors, especially those on dial-up. I also thought that people might get in, see the rate, and leave the page before it has a chance to refresh.
Following on from this, I wondered about this possib le solution:
a) Use the no-caching code (as above) on the home page
b) Place the interest rate in an iframe
c) Use the same no-caching code on the interest rate page (ie, the page that displays inside the iframe).
d) Also use a meta refresh of 1 second for this interest rate page. i.e.
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
<meta http-equiv="refresh" content="1">
I thought, since there will only be some text in the interest rate page (for example, "6.95%"), then even if it refreshes every second it won't be a problem for people on dial-up.
Anyway - this is the best idea I have come up with. Can anyone suggest whether this idea is practical, and/or suggest a better option?
Please note that I don't know any php, asp, etc languages, and am reluctant to use javascript so as to ensure that the site is fully-functional to as many people as possible.
If you are on Apache this could help in your .htaccess:
<FilesMatch "^index\.html$">
ExpiresActive On
ExpiresDefault A0
Header unset Cache-Control:
Header append Cache-Control: "no-cache, must-revalidate"
</FilesMatch>