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 / April 2004

Tip: Looking for answers? Try searching our database.

Maximum value for OutputCache Duration

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ashish M Bhonkiya - 19 Apr 2004 12:04 GMT
According to the documention the maximum value for duration is a positive
integer (2147483647), but if i specify the max value for an integer then it
thows the following error.
Specified argument was out of the range of valid values. Parameter name:
delta
can any one help.

Regards
Ashish M Bhonkiya
"rwg" - 19 Apr 2004 15:10 GMT
Which documentation and duration of what?

-rwg
This is what I think, not necessarily what is accurate!

--------------------
| From: "Ashish M Bhonkiya" <bhonkiya@hotmail.com.nospam>
| Subject: Maximum value for OutputCache Duration
[quoted text clipped - 10 lines]
| Regards
| Ashish M Bhonkiya
Ashish M Bhonkiya - 19 Apr 2004 17:16 GMT
if  you include the following on the html of the aspx pag
<%@ outputcache duration="0" varybyparam="none" %
the following error will com
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The 'duration' attribute must be set to a positive integer valu

Source Error:

Line 1:  <%@ Page language="c#" Codebehind="infinitecaching.aspx.cs" AutoEventWireup="false" Inherits="aspdotnetcaching.infinitecaching" %
Line 2:  <%@ outputcache duration="0" varybyparam="none" %
Line 3:  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
Line 4:  <html

if you see the errormessage it says the The 'duration' attribute must be set to a positive integer value. Now according to me i am using windows xp machine, and the maximum value for the integer i have computed as
2 to the power 32 minus 1 which is "2147483647" but then i get the erro
Specified argument was out of the range of valid values. Parameter name: delta
   

Regard
Ashish M Bhonkiy
    ----- "rwg" wrote: ----
   
    Which documentation and duration of what?
   
    -rw
    This is what I think, not necessarily what is accurate
   
    -------------------
    | From: "Ashish M Bhonkiya" <bhonkiya@hotmail.com.nospam
    | Subject: Maximum value for OutputCache Duration
    | Date: Mon, 19 Apr 2004 16:34:08 +053
    | Lines: 1
    |
    | According to the documention the maximum value for duration is a positiv
    | integer (2147483647), but if i specify the max value for an integer then i
    | thows the following error
    | Specified argument was out of the range of valid values. Parameter name
    | delt
    | can any one help
    |
    | Regard
    | Ashish M Bhonkiy
Scott M. - 19 Apr 2004 20:16 GMT
The number, 2147483647 corresponds to a cached time of about 68 years!  Do
you really need your data held in cache that long?

In your code below, you have 0 seconds set as the duration, which means you
DON'T want the page cached.  In this case you should just remove the page
cache directive altogether.

The OutputCache is best used when you have high volume in a short period of
time with minimal changes to the output during that time.  In these cases,
setting the cache to as small of a number as 30 or 60 can dramatically
reduce server load.  This was how the OutputCache was intended to be used.
If you need something held significantly longer than this, I would suggest
the application.cache or writing to a file.

> if  you include the following on the html of the aspx page
> <%@ outputcache duration="0" varybyparam="none" %>
> the following error will come
> Parser Error
> Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error
details and modify your source file appropriately.

> Parser Error Message: The 'duration' attribute must be set to a positive integer value
>
[quoted text clipped - 6 lines]
>
> if you see the errormessage it says the The 'duration' attribute must be set to a positive integer value. Now according to me i am using windows xp
machine, and the maximum value for the integer i have computed as
> 2 to the power 32 minus 1 which is "2147483647" but then i get the erro
> Specified argument was out of the range of valid values. Parameter name: delta
[quoted text clipped - 23 lines]
>      | Regards
>      | Ashish M Bhonkiya
Ashish M Bhonkiya - 20 Apr 2004 05:16 GMT
Hi Scott,

thanks for your reply.

in the code i have specified 0 just to reproduce the error message, which
displays the possible values for the duration attribute (a positive
integer).

i agree this is a huge time (68 years) but then if the error message
displays that it can be a positive integer it should accept the values in
that range. I was just trying to check the boundary conditions for this
range and it fails, does this means that its a bug as it fails the boundary
conditions ?

can any one explain me why ??

FYI the maximum time it allows is for one year and not more than that.

Thanks for your Time
Ashish M Bhonkiya

> The number, 2147483647 corresponds to a cached time of about 68 years!  Do
> you really need your data held in cache that long?
[quoted text clipped - 63 lines]
> >      | Regards
> >      | Ashish M Bhonkiya
Scott M. - 20 Apr 2004 13:37 GMT
I would guess it's just a documentation issue.

> Hi Scott,
>
[quoted text clipped - 89 lines]
> > >      | Regards
> > >      | Ashish M Bhonkiya
"rwg" - 20 Apr 2004 18:32 GMT
| that range. I was just trying to check the boundary conditions for this
| range and it fails, does this means that its a bug as it fails the boundary

| can any one explain me why ??

If your number if too small it gives you a "Parser Error" which tells you that you need an integer greater than zero, and if it's too large you get a "Specified
argument was out of the range of valid values" error.   They are not great messages, but it seems to be working.

-rwg
This is what I think, not necessarily what is accurate!

--------------------
| From: "Ashish M Bhonkiya" <bhonkiya@hotmail.com.nospam>
| References:  <efUZ43fJEHA.3712@TK2MSFTNGP09.phx.gbl> <5Gm6eghJEHA.3564@cpmsftngxa10.phx.gbl> <024088C3-439C-453C-8328-
82991B049C8A@microsoft.com> <uusQEMkJEHA.3596@tk2msftngp13.phx.gbl>
| Subject: Re: Maximum value for OutputCache Duration
| Date: Tue, 20 Apr 2004 09:46:16 +0530
[quoted text clipped - 91 lines]
| > >      | Regards
| > >      | Ashish M Bhonkiya
Marcelo Dabanovich Lavio - 23 Apr 2004 19:44 GMT
Hello, Ashish:

This one year limitation is due to the implementation of the
System.Web.HttpCachePolicy class on the .NET Framework class library.

The documentation for the method "public void SetMaxAge(Timespan delta)"
states that "delta" must be between Timespan.Zero and one year, or an
ArgumentOutOfRangeException will be thrown.

I don't know why they set this upper bound to this value, but it's there.
Maybe they just thought it was reasonable.

But, I think all of us will agree that there is a documentation issue to not
show the range of valid values of the "duration" attribute on <%@
OutputCache %> directive help page.

[],
Marcelo

> Hi Scott,
>
[quoted text clipped - 89 lines]
> > >      | Regards
> > >      | Ashish M Bhonkiya

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



©2008 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.