473,806 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Expire s = 60
Response.Expire sabsolute = Now() - 1
Response.AddHea der "pragma","n o-cache"
Response.AddHea der "cache-control","priva te"
Response.CacheC ontrol = "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 4083
You can set in Page directive
<% @Outputcache Location="none" %>

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

Response.Cache. SetCacheability (HttpCacheabili ty.NoCache)

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

"Daenil of GL" <webmaster@!nos pam.visualsun.w s> wrote in message
news:10******** *****@corp.supe rnews.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.Expire s = 60
Response.Expire sabsolute = Now() - 1
Response.AddHea der "pragma","n o-cache"
Response.AddHea der "cache-control","priva te"
Response.CacheC ontrol = "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 (HttpCacheablil ity.Nocache), would that
go in the old "Spaghetti Code" render blocks or something else? That is the
part that loses me.

"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:eM******** ********@TK2MSF TNGP10.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 (HttpCacheabili ty.NoCache)

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

"Daenil of GL" <webmaster@!nos pam.visualsun.w s> wrote in message
news:10******** *****@corp.supe rnews.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.Expire s = 60
Response.Expire sabsolute = Now() - 1
Response.AddHea der "pragma","n o-cache"
Response.AddHea der "cache-control","priva te"
Response.CacheC ontrol = "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="No ne" %>
<% Response.Cache. SetCacheability (HttpCacheabili ty.NoCache) %>
<% Response.CacheC ontrol = "no-cache" %>
<% Response.AddHea der ("Pragma", "no-cache") %>
<% Response.Expire s = -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@!nos pam.visualsun.w s> wrote in message
news:OP******** ********@TK2MSF TNGP12.phx.gbl. ..
Thank you for your reply.
On the Response.Cache. SetCacheability (HttpCacheablil ity.Nocache), would that go in the old "Spaghetti Code" render blocks or something else? That is the part that loses me.

"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:eM******** ********@TK2MSF TNGP10.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 (HttpCacheabili ty.NoCache)

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

"Daenil of GL" <webmaster@!nos pam.visualsun.w s> wrote in message
news:10******** *****@corp.supe rnews.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.Expire s = 60
Response.Expire sabsolute = Now() - 1
Response.AddHea der "pragma","n o-cache"
Response.AddHea der "cache-control","priva te"
Response.CacheC ontrol = "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
1356
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 takes time to display, and second thing is its working fine with same aaplication on server1 but when I am putting on server2 its not. I have content expiration checked / unchecked in IIS but no luck
1
1979
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. Rudy Mark
1
3585
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 for my website, i can call a public method of the object via javascript and it's working. When the Enable content expiration(immediately) is effective for my website, i always have a javascript error telling me that the object or the method...
2
1883
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 encrypted ticket to it. Both of these have an expiration date, but I'm not seeing how to use them. Does it make sense that these dates would ever differ? Thanks,
0
1133
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. When debugging the application and telling it to open a file in the files folder it does this without problems. However, if I type the file URL (http://localhost/app/files/test.doc)
0
1695
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 applied? Assuming mypage.aspx is the first in a sequence of pages, and mysecondpage.aspx comes after it, if the immediate expiration setting is in effect, should clicking on the Back button on mysecondpage.aspx, to return to mypage.aspx, cause...
2
1409
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 to whatever part of the application they're interacting with and they won't see the new record unless they close the browser or do a CTRL-Refresh or wait some indeterminate amount of time. I set the server to expire content immediately and...
5
1924
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 request even if the files do not change? The reason I ask is that I was having trouble with a css file not getting refreshed in the browser after the css file was updated on the server. In testing I found that I could manually update the css file on...
9
5525
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 http://www.developersdex.com ***
0
1437
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 lot of subdirectories and each one has its own set of images (I know its not best design practice, but there is a business reason behind it). Many pages on the site have quite a few images and there is a noticeable time lag each time the user...
0
9718
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10617
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10109
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3849
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.