Why does IE still cache pages even if I tell it not to using

"Cache-Control","no-cache" (Im doing this in a servlet so Im sending "no-cache" to "Cache-Control". In order words: Cache-Control=no-cache)
"cache", "no-cache"


Firefox, Chrome, Safari, my Android browser (Chrome), ALL of them dont cache the page expect IE.

Why???

Dani AI

Generated

Short answer: Internet Explorer can still show a cached copy for reasons other than a single cache header value. reported the problem is IE-only and correctly suggested an intermediate cache — that is one possibility, but there are several IE-specific behaviors to check before assuming an ISP/proxy.

First, verify what is actually happening by inspecting traffic locally (F12 Network or a proxy like Fiddler). Confirm whether IE sends a request at all when you reload or press Back/Forward. If no request is sent, the browser is replaying an in-memory/back-forward cache. If a request is sent and you get a 304, the server/proxy signalled that the resource is fresh. Look at request headers (If-Modified-Since / If-None-Match) and the full response headers so you know which layer is deciding.

On the server side, use a stronger, multi-header approach (set all of these together) and prefer the Post/Redirect/Get pattern for form submissions so back/forward won't re-show a POST response. Example servlet header settings:

response.setHeader("Cache-Control", "no-store, must-revalidate, max-age=0");
response.setHeader("Pragma", "no-cache");
response.setDateHeader("Expires", 0);

For AJAX GETs, IE historically caches aggressively; append a cache-busting query string (timestamp or version) or use POST for non-idempotent calls. If Back/Forward shows stale pages, a safe client-side trick is to avoid caching the page in the bfcache (many browsers will skip bfcache when pages have unload handlers) or force a reload on load when appropriate.

Use these steps to isolate which layer is caching — browser memory, browser HTTP cache, proxy/ISP, or your server — then apply the matching fix (headers + PRG + cache-bust).

Recommended Answers

All 2 Replies

Your ISP might also be caching things, and perhaps the others are automatically issuing a request for fresh data. Just a possibility.

Your ISP might also be caching things, and perhaps the others are automatically issuing a request for fresh data. Just a possibility.

Its not my ISP as it only occurs on IE (all versions) and I am the only one requesting things.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.