473,327 Members | 2,069 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,327 software developers and data experts.

OutputCache in web.config?

I have noticed that it is possible to create a small "DOS"-attach in IE but
pressing the reload-button (this generates 30-50 requests/second). I want
to protect my ASP.NET-site from this kind of use by caching the output of
all aspx-pages for 1 or 2 seconds.

One way of accomplishing this is to put the following line in every aspx-file.
<%@ OutputCache Duration="2" VaryByParam="*" location="client" %>

But is there any way I can accomplish this without editing every aspx-file?
Like putting something in the web.config.
I guess it would be possible to let all the aspx-pages inherit from a custom
class that sets this attribute programmatically but at the moment I cannot
do that

/nisse

Nov 19 '05 #1
1 3883
In 2.0 you can programatically set the output cache which would make this
easy...i know of know easy way to do this in 1.1 except for maybe making
some use of the HttpResponse.Cache property:
http://msdn.microsoft.com/library/de...cachetopic.asp

you could create a base page which all pages in your site inherit from and
set the cacheability in it's pagE_load event...not the same as output
caching though..

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Nils Hedström" <Ni***@online.nospam> wrote in message
news:28**********************@msnews.microsoft.com ...
I have noticed that it is possible to create a small "DOS"-attach in IE but pressing the reload-button (this generates 30-50 requests/second). I want
to protect my ASP.NET-site from this kind of use by caching the output of
all aspx-pages for 1 or 2 seconds.

One way of accomplishing this is to put the following line in every aspx-file. <%@ OutputCache Duration="2" VaryByParam="*" location="client" %>

But is there any way I can accomplish this without editing every aspx-file? Like putting something in the web.config.
I guess it would be possible to let all the aspx-pages inherit from a custom class that sets this attribute programmatically but at the moment I cannot
do that

/nisse

Nov 19 '05 #2

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

Similar topics

6
by: Tom Kiefer | last post by:
Question: If I have an ASP.NET User Control which defines/exposes a property that the page can use to specify a mode or data subset for the control to use, is there a way to tell the @OutputCache...
0
by: Bob | last post by:
I have several simple user controls (e.g. header, footer) that have static content so I thought it would be a good idea to turn on the ouput cache. So I added <%@ OutputCache Duration="600"...
0
by: Vassilis T. via .NET 247 | last post by:
The following piece of code, when on a heavily loaded server (more than 50 ASP.NET pages, most using outputcache with varybyparam, lots of users), will only cache the string - the output is not...
1
by: Barbara Alderton | last post by:
I have the following scenario: I have a user control that contains a registered menu control. The menu and other information on the user control is specific to the user accessing the site. ...
1
by: Johan Nedin | last post by:
Hello! I am having a problem with the @OutputCache page directive and Web browser Back Buttons. Problem: After setting <%@ OutputCache Location="None" %> on my pages I get the "Warning!...
5
by: Arpan | last post by:
I am using the following code to cache the page output for 60 seconds: <%@ OutputCache Duration="60" VaryByParam="*" %> <script runat="server"> Sub Page_Load(ByVal obj As Object, ByVal ea As...
2
by: Nalaka | last post by:
Hi, I get the following error, I thought at random intervals. Then I realized, that this happens around the time tha page outputCache is set to expire. So I disabled the page output cache and the...
3
by: =?Utf-8?B?TWlndWVsIElzaWRvcm8=?= | last post by:
Hi, I have an ASP.NET 2.0 application that allows content search. Search is included in all pages and a cross postback to the search results page is performed with the text inserted by the user....
2
by: =?Utf-8?B?YW5vbg==?= | last post by:
I am not sure if this is the right forum. Environment : Windows server 2008, IIS 7.0 I get the 'Could not load the file or assembly 'blowery.web.httpCompress' or one of its dependencies. The...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.