473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

content expiration?

Ok, I am looking for how you make a webpage expire immediately so when you
hit refresh, you receive new data. In old ASP, you would just do
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
Since that no longer works in ASP.NET, I was looking for how you do this
now...

Thanks,
Daniel Gormley
Visual SUN Studios
Nov 18 '05 #1
3 4067
You can set in Page directive
<% @Outputcache Location="none" %>

which should set the headers and you can do that in code:

Response.Cache.SetCacheability(HttpCacheability.No Cache)

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Daenil of GL" <webmaster@!nospam.visualsun.ws> wrote in message
news:10*************@corp.supernews.com...
Ok, I am looking for how you make a webpage expire immediately so when you
hit refresh, you receive new data. In old ASP, you would just do
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
Since that no longer works in ASP.NET, I was looking for how you do this
now...

Thanks,
Daniel Gormley
Visual SUN Studios

Nov 18 '05 #2
Thank you for your reply.
On the Response.Cache.SetCacheability(HttpCacheablility.N ocache), would that
go in the old "Spaghetti Code" render blocks or something else? That is the
part that loses me.

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:eM****************@TK2MSFTNGP10.phx.gbl...
You can set in Page directive
<% @Outputcache Location="none" %>

which should set the headers and you can do that in code:

Response.Cache.SetCacheability(HttpCacheability.No Cache)

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Daenil of GL" <webmaster@!nospam.visualsun.ws> wrote in message
news:10*************@corp.supernews.com...
Ok, I am looking for how you make a webpage expire immediately so when you hit refresh, you receive new data. In old ASP, you would just do
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
Since that no longer works in ASP.NET, I was looking for how you do this
now...

Thanks,
Daniel Gormley
Visual SUN Studios


Nov 18 '05 #3
Here is what i have tried and it doesnt work:

<%@ outputcache duration="60" varybyparam="None" %>
<% Response.Cache.SetCacheability(HttpCacheability.No Cache) %>
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader ("Pragma", "no-cache") %>
<% Response.Expires = -1 %>

This is in the very top of my page right under the <%@ Page Language="VB" %>

What am i doing wrong?

"Daenil of GL" <webmaster@!nospam.visualsun.ws> wrote in message
news:OP****************@TK2MSFTNGP12.phx.gbl...
Thank you for your reply.
On the Response.Cache.SetCacheability(HttpCacheablility.N ocache), would that go in the old "Spaghetti Code" render blocks or something else? That is the part that loses me.

"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:eM****************@TK2MSFTNGP10.phx.gbl...
You can set in Page directive
<% @Outputcache Location="none" %>

which should set the headers and you can do that in code:

Response.Cache.SetCacheability(HttpCacheability.No Cache)

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Daenil of GL" <webmaster@!nospam.visualsun.ws> wrote in message
news:10*************@corp.supernews.com...
Ok, I am looking for how you make a webpage expire immediately so when you hit refresh, you receive new data. In old ASP, you would just do
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
Since that no longer works in ASP.NET, I was looking for how you do this now...

Thanks,
Daniel Gormley
Visual SUN Studios



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: F | last post by:
Hi All I am having problem of content expiration it expires immidiately. Real problem is I am replacing some images on mouse over. On every mouse over its downloading images from server that...
1
by: Rudy Mark | last post by:
I have set content expiration in IIS 5.0 to N1 minutes. Also I have code as <meta http-equiv="refresh" content="N2">. Which will be effective in this secnarios ? Which one takes precedence....
1
by: Mario Hébert | last post by:
I have a simple C# object(class) that I reference in a <OBJECT classid="mydll.dll#nmsp.Ctrl"> tag of an HTML page generated by ASP.net. In a case where the Enable content expiration isn't checked...
2
by: Bill Borg | last post by:
Hello all, I am working on forms authentication and trying to understand: what's the relationship between the cookie expiration and the ticket expiration? I create a cookie and I add an...
0
by: theintrepidfox | last post by:
Dear Group Just noticed that there's a problem with Visual Studio and IIS Content Expiration. I do have a files sub directory and had Contend Expiration set to immediately for that folder. ...
0
by: TR | last post by:
If mypage.aspx is set to expire immediately using the management console page properties dialog, HttpHeaders tab, -- does the expiration setting take effect as soon as the dialog changes are...
2
by: Jason Kendall | last post by:
I've noticed that my ASP.Net projects suffer from being cached locally when my users' broswers are set to automatically check for newer pages. Folks will go through the process of 'adding' an item...
5
by: Frankie | last post by:
Using ASP.NET 1.1 and IIS 6... what is the effect of enabling Content Expiration -- Expire Immediately? Does it cause the files in the virtual directory to be served on every single browser...
9
by: Mike Reed | last post by:
I must be having a "senile" day! I cannot recall, nor get to work, code to read a cookie's expiration date/time in an ASP page/VBScript. What am I missing? *** Sent via Developersdex...
0
by: mohdowais | last post by:
I have just stumbled upon an what seems to be a very under-rated feature in IIS - the "Enable Content Expiration" option under a website's properties. I have an ASP.NET web application that has a...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.