Evaluating instead of compiling the IronPython page at every request

Last post 07-07-2008 1:56 AM by davidebb. 4 replies.

Sort Posts:

  • Evaluating instead of compiling the IronPython page at every request

    08-18-2007, 1:42 AM

     Hi there,

     I am working on a Virtual Path Provider that server IronPython .aspx page as needed.

    With VPP, I have the ability to modify the IronPython source code of the ASPX page on the fly. The problem is, I cannot figure out a way to force ASP.Net to check the source everytime it receives a request. So there's always a delay between the source code change in the VPP back end to the "in memory" ASPX page that IIS serves.

     
    Is there any way or setting in the current VPP to allow this behaviour (Always check source - do not cache) in ASP.Net futures?


     

  • Re: Evaluating instead of compiling the IronPython page at every request

    08-18-2007, 5:15 PM
    Answer
    • Loading...
    • davidebb
    • Joined on 06-11-2002, 8:31 AM
    • Redmond, WA
    • Posts 974
    • AspNetTeam

    I think you should be able to make that work by implementing GetCacheDependency() on your VPP and returning a CacheDependency that expires right away, or something like that.

    David

  • Re: Evaluating instead of compiling the IronPython page at every request

    08-21-2007, 6:18 AM

    Dude, you rock. Thank you so much.

     

    1    if (virtualPath.EndsWith(".aspx") | virtualPath.EndsWith(".ascx"))
    2    {
    3       return new CacheDependency(new string[] { HttpContext.Current.Server.MapPath("/default.aspx") }, new string[] { DateTime.Now.ToString() }, null);
    4    }
    5    else
    6    {
    7        return base.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart);
    8    }
    
     
  • Re: Evaluating instead of compiling the IronPython page at every request

    07-07-2008, 1:47 AM

    Hi,

    Just read your article - are you able to post what method you override in the Virtual Path Provider implementation. We are trying to work out how to expire page content based on information being modified within a database (ie use a Database dependency)

    Thanks

  • Re: Evaluating instead of compiling the IronPython page at every request

    07-07-2008, 1:56 AM
    • Loading...
    • davidebb
    • Joined on 06-11-2002, 8:31 AM
    • Redmond, WA
    • Posts 974
    • AspNetTeam

    GetCacheDependency is the method where this code goes.

    David

Page 1 of 1 (5 items)
Microsoft Communities
Page view counter