devxlogo

Control How Browsers Cache Your Page

Control How Browsers Cache Your Page

Question:
Is there a way to force a page to load from the server rather than from the cache? The META refresh and onLoad=reload() both just send the page into an infinite loop.

Answer:

Yes, you can use META tags to control how browsers cache your pages. This tag specifically asks your browser not to cache the current page:

This other META tag construct tells the browser that if it does cache the page, it should remove it from the cache on the specified date (in this case, January 1, 1999 at 1am).

If you really don’t want a browser to cache your page you should use these two tags together, specifying a date in the past for the second tag.

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist