Why is my Cache expiring???

Discussion in 'Site Programming, Development and Design' started by mtatro, Aug 1, 2010.

  1. All:
    I have a set of webservices that keep a 'key' in the application cache. If used on the development system, everything works just fine, but on the Winhost environment the cache expires after just 30 seconds or so.

    I am using:

    Context.Cache.Insert(key, _id, null, DateTime.Now.AddHours(1), TimeSpan.Zero, CacheItemPriority.High, onRemove);

    to write the value into the cache. No matter what I seem to do, the value is being cleared from the cache...

    Any suggestions?

    Last edited by a moderator: Oct 14, 2015
  2. Ray


    Are you sure you set your session timeout correctly. Make sure you have it set for 20 minutes.
  3. Yes, it is set to 20 minutes...

    Not sure what is causing this, but what else can I do, it is pretty crucial to get this working...

  4. Ray


    Your application pool maybe getting recycled by the server. Winhost servers has 3 thresholds set in place that when your application meets it, will get it to be recycled. These are the conditions.

    1) More than 20 minutes of idle time (no http request in 20 minutes)
    2) The application uses more than 100 MB memory
    3) The application uses more than 75% of CPU time
    Last edited by a moderator: Oct 14, 2015
  5. Ray,
    this is a simple web service that retrieves some data from the database..I highly doubt that it would ever use 100% CPU time or any memory even close to the limit (it sure doesn't on my dev machine...). I will write a small test app to check, then perhaps you guys can figure out what is happening...

  6. Ray


    Open a ticket to support and ask them to check the event logs if your application pool is being recycled by the system.
  7. thanks, will do...

Share This Page