html5 force browser to reload or get a new cache

Hi, I changed a link on my html pages in a site, and I want to be sure people who go there will see the new link and not the old one. What's the newest way to do this?

EG: Used to be <a href="clients.html">Client Feedback</a>, now is <a href="comments/">Client Feedback</a>

Melody ScottAsked:
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.

Dave BaldwinFixer of ProblemsCommented:
There is no way for a page to force a browser to go to a new page until the page in the browser cache expires.  Browser cache on the client is out of reach of the page on the server.

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
Sergio Pacheco JiménezAnalyst DeveloperCommented:
There is a way to force the browser to don't use the cache  files. This technique is call Cache busting, and basically you have to add a random query at the end of the URL to force the download of the new file e.g.: "test.js?test=1"

Here is a useful link with more information:
Melody ScottAuthor Commented:
Thanks, Sergio, this is usually used for css and js files, not static html pages. Dave, I find that surprising, but you're the expert. :)
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Melody ScottAuthor Commented:
It seems so strange, that if I change a link in the navigation, people will see the old link until their cache expires. But I accept your answer, thanks!
Dave BaldwinFixer of ProblemsCommented:
Note that the default cache expiration time in Internet Explorer used to be 20 days...  and while Sergio's idea is frequently used, you still have to wait for the current cache content to expire before you can use it.
Melody ScottAuthor Commented:
So... in the circumstance  I talked about, where I replaced an internal link in the navigation, I guess the only way to make customers go to the new page would be to do a 301 redirect, I guess? Permanent redirect clients.html to the new url?
Dave BaldwinFixer of ProblemsCommented:
No, it has no effect because the browser gets the page from cache and never goes to the server.  Changes are recognized Only when a page is fetched from the server.  Note this can be an even bigger problem with CSS and 'js' files that have changed but the name doesn't change.  Sometimes the main HTML page will change but if the CSS and JS file names don't change, then they will still be fetched from cache.
Melody ScottAuthor Commented:
Ok, crazy, man. Seems like there should be a way around it, but thanks for taking the time and having the patience to explain it to me. :)
Dave BaldwinFixer of ProblemsCommented:
The purpose of cache is to speed it up for the client, not the developer.  After you're done, most sites don't change for a long time so that works.  In Google PageSpeed, that is one of the recommendations, "Leverage Browser Caching." by getting the browser to cache things longer.  For development, you can still force a refresh and see the new content.
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
Web Development

From novice to tech pro — start learning today.