Re: <%@ OutputCache Duration="30" VaryByParam="none" %>

From: Juan T. Llibre (nomailreplies_at_nowhere.com)
Date: 02/10/05


Date: Thu, 10 Feb 2005 11:55:12 -0400

Glad to see you worked it out...

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espa?ol
=====================

"z. f." <zigi@info-scopeREMSPAM.co.il> wrote in message
news:%235cgXf4DFHA.3256@tk2msftngp13.phx.gbl...
ok everything is cool, the articles tell what i thought in the first place.
i found my problem

using response.flush inside the code actually cancels the caching.

how should i know about it?

i don't think anywhere this is told.

i had to put and remove all kinds of functions in my code in order to trace
this.

is this a must?

who knows......

  "Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
news:eA36Bx3DFHA.1932@TK2MSFTNGP14.phx.gbl...
  z,

  Could you read these articles,
  and then come back with any questions you might still have ?

  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-cachingtechniquesbestpract.asp

  http://msdn.microsoft.com/asp.net/community/authors/rhoward/default.aspx?pull=/library/en-us/dnaspnet/html/asp03282002.asp

  From this last article :

  VaryByParam: This attribute allows us to control how many cached
  versions of the page should be created based on name/value pairs
  sent through HTTP POST/GET.

  The default value is None.

  None implies that only one version of the page is added to the Cache,
  and all HTTP GET/POST parameters are simply ignored.

  The opposite of the None value is *.

  The asterisk implies that all name/value pairs passed in are to be used
  to create cached versions of the page.

  The granularity can be controlled, however, by naming parameters
  (multiple parameter names are separated using semi-colons).

  Juan T. Llibre
  ASP.NET MVP
  http://asp.net.do/foros/
  Foros de ASP.NET en Espa?ol
  =====================

  "z. f." <zigi@info-scopeREMSPAM.co.il> wrote in message
  news:uDWNnq3DFHA.624@TK2MSFTNGP09.phx.gbl...
  i'm trying to understand you

  if i have a categoryID parameter for my page.
  and i have VaryByParam=none i should get the first cached snapshot of the
  page what ever parameter is sent after the page being cached.
  at least that's what i thought.

  so what is happening with this page when it gets 2 different requests, it
  gives fresh data?

  what you mean i your last line (i quote:)
  A VaryByParam of "none", won't *cache* by parameters,
  but the *data returned* will, still, vary by parameters

  so VaryByParam of "none" won't cache the page at all and gives fresh
data?

  another question:

  if i put a response.write of the timestamp in my page_load
  of a chached page,
  shouldn't the value not change between cached requests?
  my method should not execute if the output is being cached, so why does it
  execute?

  TIA, z.

    "Juan T. Llibre" <nomailreplies@nowhere.com> wrote in message
  news:OFpufk3DFHA.2600@TK2MSFTNGP09.phx.gbl...
    z.,

    When you make requests with different parameters,
    you *should* get different data returned.

    That's the *purpose* of parameters, to enable dynamic data
    to be returned depending on the parameter sent.

    If you set VaryByParam to "none", all that means
    is that the *caching* won't vary by parameters.

    The *data* will, still, vary by parameters.

    A VaryByParam of "categoryID" would create separate
    *cache entries* for every categoryID in a catalog, for example.

    A VaryByParam of "none", won't *cache* by parameters,
    but the *data returned* will, still, vary by parameters.

    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Espa?ol
    =====================

    "z. f." <zigi@info-scopeREMSPAM.co.il> wrote in message
    news:eD2$JV1DFHA.1576@TK2MSFTNGP09.phx.gbl...
    sorry about the previous post, by mistake not completed.

    i have an asp.net page with the line
    <%@ OutputCache Duration="30" VaryByParam="none" %>

    but when i make requests to the page with different parameters, i get
    different result,

    but i tries to check if i set the VaryByParam to none there should be
the
    same output for different parameters, so why does it not work?

    TIA, z.



Relevant Pages

  • Re: MFC Goldmine site updated
    ... That is what oll of those "killfilers" say, ... while following the articles they have killfiled. ... MVP Tips: http://www.flounder.com/mvp_tips.htm ...
    (microsoft.public.vc.mfc)
  • Re: Font size based on the client rectangle of the control.
    ... Bob Powell [MVP] wrote: ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Special Characters in Query String
    ... > ASP.NET MVP ... > Foros de ASP.NET en Español ... > Ven, y hablemos de ASP.NET... ... >> They are identical except for the file encoding. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Hmmm
    ... It seems like the best thing to do it to wait for an MVP on ... > questions and I'll answer C# language questions if John or Nick doesn't ... > Find great Windows Forms articles in Windows Forms Tips and Tricks ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Formatting in Word 2002
    ... Because HTML formatting and Word's document layout can be very different, ... Word MVP FAQ site: http://word.mvps.org ... There are table borders and there are gridlines. ... much time looking for articles so decided to take the plunge. ...
    (microsoft.public.word.newusers)