JoshBaltzell
JoshBaltzell

Reputation: 1494

Can a corporate proxy cache whole pages?

We are seeing some odd errors when our customers test our ASP.NET web apps. There is a cart counter on the top of every page that tells you how many items are in the shopping cart. She reports that this number is changing as she moves from one page to the next. We cannot recreate this.

Is it possible that her corporate proxy server is caching the whole page and never actually contacting our server? This is a staging site on http, her production site is on https.

Revision: The page gets cached over HTTPS as well. It shows a completely cached version of our shopping cart page. If the user clicks the refresh button they get a current version of the page, but that new version becomes the cached version.

Upvotes: 3

Views: 367

Answers (2)

David
David

Reputation: 34573

There's also a setting in IE that could cause this behavior. Go to "Tools" > "Internet Options". On the "General" tab, click "Settings" under "Browsing History". Make sure "Check for newer versions of stored pages" is set to "Automatically". This is the default value.

I had a user who changed this to "Never" and was wondering why he always saw old content. :)

Upvotes: 2

Asaph
Asaph

Reputation: 162849

It's certainly possible that an intermediate proxy (corporate or otherwise) is caching your pages. Although I don't understand how that would explain the cart number on the page changing. If you don't want any caching to take place, send the appropriate HTTP headers along with each request you don't want cached:

Cache-Control: private, no-store, max-age=0
Expires: <some date in the past>
Pragma: no-cache

The first line above is for HTTP 1.1 clients, and the second 2 are for HTTP 1.0 clients. Check out section 14.9 of the HTTP 1.1 protocol spec for all the gory details.

Upvotes: 3

Related Questions