.NETGURU
Can Someone Explain This Caching Behavior
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngcache' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Skowronski, Thomas
Hello,

Is output caching supposed to serve page refreshes from the cache or is the
page re-run?

I have a very simple test page that does send the cached response if I
retype the url in the browser or if I access the page from a second browser
window.
If I open the page, and then hit the refresh button on my browser, then the
page is re-run every time I hit the refresh button, and I do not get the
cached version.
Is there something I am missing (web.config maybe?...I do not see anything
in my web.config file about caching) that is causing this behavior or is
this normal.
I have also tried wrapping the CreatedStamp.InnerHtml = Now() line in an If
Page.IsPostBack = False block, but this also did not change the behavior
described above.

I am running Windows 2000 Professional, and the .Net framework that came
with Visual Studio .Net Beta 2.
The code for my page (SimpleExample.aspx) is below:

<%@ OutputCache Duration="60" VaryByParam="none"%>

<Script runat="server">
Public Sub Page_Load()
    CreatedStamp.InnerHtml = Now()
End Sub
</Script>

Output Cache created: <label id="CreatedStamp" runat="server" />

As always, thank you for your assistance,

Tom Skowronski

Reply to this message...
 
    
Douglas Reilly
Have you installed the Premium version of ASP.NET, available at www.asp.net?
With Beta 2, that was required to get caching and a couple of other
features.

----- Original Message -----
From: "Skowronski, Thomas" <Click here to reveal e-mail address>
To: "aspngcache" <Click here to reveal e-mail address>
Sent: Wednesday, November 21, 2001 4:42 PM
Subject: [aspngcache] Can Someone Explain This Caching Behavior

[Original message clipped]

Reply to this message...
 
    
Tim Mackey
hi thomas
i copied your code into a new file, and the caching worked properly. showed
the cached version with the same creation date, until i waited more than 60
seconds, then it made a new version. same effect across new sessions /
browser windows.

i don't have any caching settings in web.config file.

no ideas why it shouldn't be working.
anyone else?

tim

----------------------------------------
Tim Mackey
www.ScootASP.NET
.NET hosting ($10/mo) and code center
----------------------------------------

----- Original Message -----
From: "Skowronski, Thomas" <Click here to reveal e-mail address>
To: "aspngcache" <Click here to reveal e-mail address>
Sent: Wednesday, November 21, 2001 9:42 PM
Subject: [aspngcache] Can Someone Explain This Caching Behavior

Hello,

Is output caching supposed to serve page refreshes from the cache or is the
page re-run?

I have a very simple test page that does send the cached response if I
retype the url in the browser or if I access the page from a second browser
window.
If I open the page, and then hit the refresh button on my browser, then the
page is re-run every time I hit the refresh button, and I do not get the
cached version.
Is there something I am missing (web.config maybe?...I do not see anything
in my web.config file about caching) that is causing this behavior or is
this normal.
I have also tried wrapping the CreatedStamp.InnerHtml = Now() line in an If
Page.IsPostBack = False block, but this also did not change the behavior
described above.

I am running Windows 2000 Professional, and the .Net framework that came
with Visual Studio .Net Beta 2.
The code for my page (SimpleExample.aspx) is below:

<%@ OutputCache Duration="60" VaryByParam="none"%>

<Script runat="server">
Public Sub Page_Load()
CreatedStamp.InnerHtml = Now()
End Sub
</Script>

Output Cache created: <label id="CreatedStamp" runat="server" />

As always, thank you for your assistance,

Tom Skowronski

| [aspngcache] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp = JOIN/QUIT

Reply to this message...
 
    
Rob Howard (VIP)
I can't reproduce this...

What browser are you using?

Thanks
Rob

-----Original Message-----
From: Skowronski, Thomas
[mailto:Click here to reveal e-mail address]=20
Sent: Wednesday, November 21, 2001 1:43 PM
To: aspngcache
Subject: [aspngcache] Can Someone Explain This Caching Behavior

Hello,=20

Is output caching supposed to serve page refreshes from the cache or is
the
page re-run?

I have a very simple test page that does send the cached response if I
retype the url in the browser or if I access the page from a second
browser
window. =20
If I open the page, and then hit the refresh button on my browser, then
the
page is re-run every time I hit the refresh button, and I do not get the
cached version. =20
Is there something I am missing (web.config maybe?...I do not see
anything
in my web.config file about caching) that is causing this behavior or is
this normal. =20
I have also tried wrapping the CreatedStamp.InnerHtml =3D Now() line in =
an
If
Page.IsPostBack =3D False block, but this also did not change the =
behavior
described above.

I am running Windows 2000 Professional, and the .Net framework that came
with Visual Studio .Net Beta 2. =20
The code for my page (SimpleExample.aspx) is below:

<%@ OutputCache Duration=3D"60" VaryByParam=3D"none"%>

<Script runat=3D"server">
Public Sub Page_Load()
    CreatedStamp.InnerHtml =3D Now()
End Sub
</Script>

Output Cache created: <label id=3D"CreatedStamp" runat=3D"server" />

As always, thank you for your assistance,

Tom Skowronski

| [aspngcache] member Click here to reveal e-mail address =3D YOUR ID
| http://www.aspfriends.com/aspfriends/aspngcache.asp =3D JOIN/QUIT

Reply to this message...
 
 
System.Web.UI.Page




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification