Force Refresh Code that Has Force

Hi,

Found these meta tags to ensure a page always reloads.

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">

Open in new window


Seen some pages where, despite having them, the cache still is used.

What can you recommend to add to these to be sure that the page arrives fresh each time?

Thanks!

OT
oaktreesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nociSoftware EngineerCommented:
slight random changes in the URL? if you dont use the query part add a ?id=<large-randomnumber> to the URL?
oaktreesAuthor Commented:
This was like a dead simple url. A homepage.  No trailing queries at all.

Something like www.loremmmipppsum.com

Nothing to it than the URL itself.

Is

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">

Open in new window


all that is needed?  Or, are there other strategies?
ste5anSenior DeveloperCommented:
As the tags attribute names say: http-equiv.

These values can also be sent in the HTTP header.

But the HTTP header values have precedence over the HTML meta values (see HTML Document Representation).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

oaktreesAuthor Commented:
I'm confused.  How should we write them if we want them as header values?  Seems like metas are in the header already.  Am I right?
ste5anSenior DeveloperCommented:
It depends on your use web server and whether you have full control over it and how you create/deliver content.

In the case of Apache, read it's Caching Guide.
When using PHP you may control per file using the header() method.
oaktreesAuthor Commented:
Hi,

Ok.  Thanks.

Please give me some time to review before we close this question.

Many thanks,

OT
oaktreesAuthor Commented:
Thanks! :)))
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.