OutputCache

L

Liming

Hi all,

A quick question on Cache. I'm not sure what I'm doing wrong. I'm
testing out two pages. Page1 and Page2. Page1 click a button, redirect
to page 2.

on both page, i have

<%@ OutputCache Duration="1" Location="None" VaryByParam="none" %>

and on both page_load, I try to do print on the current time.

Page1

4/20/2006 2:54:51 AM

Page 2

4/20/2006 2:54:57 AM

Once I get on Page2, I click 'browser back" button, and I'm still
seeing 4/20/2006 2:54:51 AM on Page1. It's a cached page. I need to
see the new time (which should be later than 2:54:57).

What am I doing wrong? I'm using Firefox 1.5

Thanks
 
K

Karl Seguin [MVP]

The file is cached is being cached on the browser. You need to use code
like:

Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"I see little point in setting the
outpucache duration to 1...Karl-- http://www.openmymind.net/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top