cache on discountasp

Discussion in 'ASP.NET 2.0' started by Bruce, Jun 17, 2007.

  1. Bruce

    Bruce DiscountASP.NET Staff

  2. Hi Bruce, thanks 4 replying.

    As a matter of fact, it does work (in part...)with "none" - see:
    http://www.dc2ny.com/pages/testCacheNoParams.aspx

    but what does it mean?

    in other server that i uploaded the files for testing u can see that everithing work perfect in all casses:

    http://www.swat-il.com/pages/testCache.aspx- first cache version
    http://www.swat-il.com/pages/testCache.aspx?lang=en- different cache version

    in the above links u can c that the server renders 2 differnt version of the page, becaus the verybyparam was "lang" - like in the example i've posted, and when i used "none" the "lang=en" didnt make a different(and thats the way it soppose to be):

    http://www.swat-il.com/pages/testCacheNoParams.aspx

    http://www.swat-il.com/pages/testCacheNoParams.aspx?lang=en

    the same page returned.

    but on the DiscountASP servers, the "none" works only if the query string is empty, but if i do add "lang=??" it render a different page every time:
    http://www.dc2ny.com/pages/testCacheNoParams.aspx?lang=en

    thats why i've concluded that there is somthing wrong on the DiscountASP servers when it comes to cache.

    P.S. i uploaded a file to the url: http://www.dc2ny.com/pages/pages.rarthat includes the 4 files above, u can test them anywhere and c that thay r working as expected, expet here :-(

    thanks
    ilan
     
  3. Hi all.
    i run into a small thread here that i cant find again.
    it decribed a caching problem on the discountasp servers, and i'm having the exact same problem.
    u c, on my localhost the next code is working exactly as expected, but on the hostin it does not.

    here is the code (based on the message that i cant find...):

    in the aspx file:



    <%@ Page Language="C#" CodeFile="testCache.aspx.cs" Inherits="testCache" EnableViewState="false" %>


    <%@ OutputCache Duration="300" VaryByParam="lang" %>


    in th code behind:


    using System;


    public partial class testCache : System.Web.UI.Page


    {


    protected void Page_Load(object sender, EventArgs e)


    {


    Response.Write("<html><h1>Cache Test: " + DateTime.Now.ToString() + "</h1>\n");


    for (int i = 0; i < 10; i++)


    Response.Write("<li>Just adding some content ....." + DateTime.Now.ToString() + "\n");


    Response.Write("</body></html>\n");


    }


    }


    here is a link to the online page:


    http://www.dc2ny.com/pages/testCache.aspx


    try it there, and see that every F5 will recreate the page.


    now create that simple file on your machin, and see that the caching is working like a charm...


    any suggestions?


    10x


    ilan
     
  4. I tried all the links you provided and everything works as expected.I also uploaded the files on the test server with time duration set to 10 secs and its works fine too.

    See:

    http://daspstaff00.web120.discountasp.net/cache/testCacheNoParams.aspx?lang=en (updated lang param with different values and still doesnt change until the next 10 secs)

    http://daspstaff00.web120.discountasp.net/cache/testCache.aspx?lang=rrr (Changes whenever I change the param 'lang' otherwise doesnt update the page )

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. Hello Vikram.</o:p>
    </o:p>
    Thanks for the effort u put in this, and for checking everything.</o:p>
    </o:p>
    Now i said from the beginning that the cache worked some times - and its still does.</o:p>
    Obviously, if it was never working, i wasn't the only one complaining. i checked the links I've posted many time before i post them - and they did not worked. I've checked now - and they do.</o:p>
    That drive me crazy, cause as a developer i know that the hardest BUGS to catch are those who don't behave the same always.</o:p>
    </o:p>
    But even though those link working correctly now, I'm afraid that my web site is not. And the same pages - exactly work someplace else.</o:p>
    </o:p>
    I guess I need a little "luck" on showing u that its not that I have free extra time but there is a problem. J</o:p>
    </o:p>
    </o:p>
    Thanks again.
    </o:p>
    Frustrated, ilan</o:p>
    </o:p>
    </o:p>
     
  6. Bruce

    Bruce DiscountASP.NET Staff

    I have 1 guess. Could it be that the processing was recycled in between hits?


    Do you still have the page on your site? I can give it a test.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  7. Bruce

    Bruce DiscountASP.NET Staff

    In my test, I made a initial hit to the page and the caching continue to work. I killed the worker process and refresh my page, the cache is gone.

    I think ASP.NET caches the data in memory and when the process is recycled the cache is gone.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  8. Hi Bruce.


    i've put the files back on line.
    but what does it mean "processing was recycled in between hits" ?
     
  9. Hi Bruce, thanks for the effort you put into this.

    I'm afraid i dont understandWhat does it means thogh... can u explain a bit please?

    10x
    ilan
     
  10. Bruce

    Bruce DiscountASP.NET Staff

    How are you generating your chart? Is it from a SQL server (hosted w/ us or others)?


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  11. Are u reffering the dates list on the sample page? thaay just creatd there on the fly with simple loop.
    but in the real world (www.dc2ny.con) on your servers i do use SQL SERVER hosted also by on you.

    ilan
     
  12. Well,it seems by default the cached page is stored is stored on the server memory.Therefore whenever the process is recycled(for several reasons) the cache is gone.

    Try setting the 'location' attribute within the OutputCache directive to client or ServerAndClient and see if this helps .This would store the cached version of the page on the browser client where the request was originated.

    Reference :http://msdn2.microsoft.com/en-us/library/hdxfb6cy.aspx
    http://msdn2.microsoft.com/en-us/library/system.web.ui.outputcachelocation.aspx (location options)

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  13. Hi Vikram.

    Actualyy i did try to play with the location definition, but i will explore it more, and i'll post the resaults here when i will finish testing

    thanks
    ilan
     

Share This Page