Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / November 2003

Tip: Looking for answers? Try searching our database.

OutputCache does not seem to work

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lance - 11 Nov 2003 13:05 GMT
Hi,

I can't seem to get the OutputCache directive to work.  Is there some switch
in the webconfig, or somewhere that I am unaware of, to turn this on?  Every
refresh seems to just recompile the page, and give me the current time,
instead of waiting two minutes before fetching a fresh page.  Argh.

Here is some sample code:

<%@ Page language=C# %>
<%@ OutputCache Duration="120" VaryByParam="none" %>
<%@ Import Namespace="System.Threading" %>
<html> <head>
<title>
</title>
</head>
<script runat=server>

protected void Page_Load(Object src, EventArgs e)
{
msg.Text = "Timestamp: " + DateTime.Now.ToString();
}
</script>
<body>
<form runat="server">
<h1>OutputCache</h1>
<asp:Label id="msg" runat=server/>
<br>
</form>
</body> </html
Jim Cheshire [MSFT] - 11 Nov 2003 15:45 GMT
Lance,

Your code should work fine and should cache the page for 2 minutes.  If you
are seeing a compile of the page on each request, that indicates that you
are touching that page with something that is altering it such as
anti-virus software or Index Services.  Is that a possibility?

Jim Cheshire [MSFT]
Developer Support
ASP.NET
jamesche@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
>From: "Lance" <lancestuff27@hotmail.com(remove this)>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.caching
[quoted text clipped - 9 lines]
>Lines: 32
>Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-
post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
>Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.caching:1797
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.caching
>
[quoted text clipped - 28 lines]
></form>
></body> </html
Lance - 12 Nov 2003 13:58 GMT
Well, it is on my Win2k pro box, I just turned off indexing for that file,
and I still  have the same result.  I don't have any anti-viral software
running.

Something that I just noticed is that there are not any caching meta tags
being served up in the resultant page.  I would assume that this is an
issue.  Here is what I get as output:

<html> <head>
<title>
</title>
</head>

<body>
<form name="_ctl0" method="post" action="test.aspx" id="_ctl0">
<input type="hidden" name="__VIEWSTATE"
value="dDw4MDE0NzI0MDA7dDw7bDxpPDI+Oz47bDx0PDtsPGk8MT47PjtsPHQ8cDxwPGw8VGV4d
Ds+O2w8VGltZXN0YW1wOiAxMi8xMS8yMDAzIDEzOjU2OjE0Oz4+Oz47Oz47Pj47Pj47PvSRW0SIO
L0ghPmjpHTFTFFy26jg" />

<h1>OutputCache</h1>
<span id="msg">Timestamp: 12/11/2003 13:56:14</span>
<br>
</form>
</body> </html>

> Lance,
>
[quoted text clipped - 24 lines]
> >Lines: 32
> >Path:

cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin

e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-
> post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
> >Xref: cpmsftngxa06.phx.gbl
[quoted text clipped - 33 lines]
> ></form>
> ></body> </html
Jim Cheshire [MSFT] - 13 Nov 2003 16:38 GMT
Lance,

Don't run Index Services on any of your content.  As soon as it touches the
files there, it causes a change notify from Windows which will cause the
app domain to recycle.  

Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
jamesche@online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

--------------------
>From: "Lance" <lancestuff27@hotmail.com(remove this)>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.caching
[quoted text clipped - 3 lines]
>Message-ID: <vr4fan7gdrbdd0@corp.supernews.com>
>References: <vr1nscggp3pd04@corp.supernews.com>
<wbuWbrGqDHA.1372@cpmsftngxa06.phx.gbl>
>X-Priority: 3
>X-MSMail-Priority: Normal
[quoted text clipped - 3 lines]
>Lines: 109
>Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-
post-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail
>Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.caching:1814
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.caching
>
[quoted text clipped - 94 lines]
>> ></form>
>> ></body> </html
S Gopikrishna - 12 Nov 2003 07:12 GMT
Hi There

Make sure you are not using BETA 2 version of framework
as Output cache is not supported in it.

-Gopi
>-----Original Message-----
>Hi,
[quoted text clipped - 29 lines]
>
>.
Lance - 12 Nov 2003 14:00 GMT
I think I have the 1.1 .NET Framework SDK installed.  That's what it says in
my program menu anyway.

> Hi There
>
[quoted text clipped - 39 lines]
> >
> >.
Lance - 12 Nov 2003 16:40 GMT
my exact version is: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET
Version:1.1.4322.573

> I think I have the 1.1 .NET Framework SDK installed.  That's what it says in
> my program menu anyway.
[quoted text clipped - 42 lines]
> > >
> > >.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.