473,394 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Scheduling a Cache refresh

i have an asp.net application and I want to save the results of an sql
query in cache. Because the queries take 28 seconds to run (there are
twelve similar queries) I want to run it all at 4am, Place the
results in cache and use those values the rest of the day for all
users.

I have something like this

CallMe = New Caching.CacheItemRemovedCallback(AddressOf
Refresh)
Context.Cache.Insert(CacheKey, SomeObject,Nothing,
EarlyMornindDateTime), Context.Cache.NoSlidingExpiration,
Caching.CacheItemPriority.High, CallMe)

The Refresh function in the CallMe object doesn't run when the time
expires. It runs only if a user request the value in the cache then it
checks the expiry time and then fires the callback function. Cache is
refreshed by the first user to acces cache not automatical by the
system at 4am

Just a reminder. I cannot run a console program or a service. The IIS
server is locked down. It has to be an asp.net based solution within
the same application. Version 1.1 of framework is used.

Some one out there must have had similar problems to this

Any Help appreciated
Nov 19 '05 #1
4 4355
IIS most likely requires a user (of sorts) to interact with an app. The
server is locked down, but what about running a task from a different
machine. In this case, what you could do is to create a webservice which
has a command to refresh the cache. Then your scheduled app could call the
webservice and invoke the action. Or this program could use an
HttpWebRequest to simply access any page on the site, then the site would
have the code to determine the time and run update the cache.

"Erick" <jo**********@hotmail.com> wrote in message
news:e1**************************@posting.google.c om...
i have an asp.net application and I want to save the results of an sql
query in cache. Because the queries take 28 seconds to run (there are
twelve similar queries) I want to run it all at 4am, Place the
results in cache and use those values the rest of the day for all
users.

I have something like this

CallMe = New Caching.CacheItemRemovedCallback(AddressOf
Refresh)
Context.Cache.Insert(CacheKey, SomeObject,Nothing,
EarlyMornindDateTime), Context.Cache.NoSlidingExpiration,
Caching.CacheItemPriority.High, CallMe)

The Refresh function in the CallMe object doesn't run when the time
expires. It runs only if a user request the value in the cache then it
checks the expiry time and then fires the callback function. Cache is
refreshed by the first user to acces cache not automatical by the
system at 4am

Just a reminder. I cannot run a console program or a service. The IIS
server is locked down. It has to be an asp.net based solution within
the same application. Version 1.1 of framework is used.

Some one out there must have had similar problems to this

Any Help appreciated

Nov 19 '05 #2
if your server is locked down, you need to also check the asp.net timeout,
as this will normally be set. if you site has no activity for a given amount
of time, then the appdomain is unloaded, and you lose all cache items.
usually this means the first person to hit the morning pay the startup cost
(compile, domain load, etc)

-- bruce (sqlwork.com)
"Erick" <jo**********@hotmail.com> wrote in message
news:e1**************************@posting.google.c om...
| i have an asp.net application and I want to save the results of an sql
| query in cache. Because the queries take 28 seconds to run (there are
| twelve similar queries) I want to run it all at 4am, Place the
| results in cache and use those values the rest of the day for all
| users.
|
| I have something like this
|
| CallMe = New Caching.CacheItemRemovedCallback(AddressOf
| Refresh)
| Context.Cache.Insert(CacheKey, SomeObject,Nothing,
| EarlyMornindDateTime), Context.Cache.NoSlidingExpiration,
| Caching.CacheItemPriority.High, CallMe)
|
| The Refresh function in the CallMe object doesn't run when the time
| expires. It runs only if a user request the value in the cache then it
| checks the expiry time and then fires the callback function. Cache is
| refreshed by the first user to acces cache not automatical by the
| system at 4am
|
| Just a reminder. I cannot run a console program or a service. The IIS
| server is locked down. It has to be an asp.net based solution within
| the same application. Version 1.1 of framework is used.
|
| Some one out there must have had similar problems to this
|
| Any Help appreciated
Nov 19 '05 #3
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message news:<ey**************@tk2msftngp13.phx.gbl>...
IIS most likely requires a user (of sorts) to interact with an app. The
server is locked down, but what about running a task from a different
machine. In this case, what you could do is to create a webservice which
has a command to refresh the cache. Then your scheduled app could call the
webservice and invoke the action. Or this program could use an
HttpWebRequest to simply access any page on the site, then the site would
have the code to determine the time and run update the cache.

"Erick" <jo**********@hotmail.com> wrote in message
news:e1**************************@posting.google.c om...
i have an asp.net application and I want to save the results of an sql
query in cache. Because the queries take 28 seconds to run (there are
twelve similar queries) I want to run it all at 4am, Place the
results in cache and use those values the rest of the day for all
users.

I have something like this

CallMe = New Caching.CacheItemRemovedCallback(AddressOf
Refresh)
Context.Cache.Insert(CacheKey, SomeObject,Nothing,
EarlyMornindDateTime), Context.Cache.NoSlidingExpiration,
Caching.CacheItemPriority.High, CallMe)

The Refresh function in the CallMe object doesn't run when the time
expires. It runs only if a user request the value in the cache then it
checks the expiry time and then fires the callback function. Cache is
refreshed by the first user to acces cache not automatical by the
system at 4am

Just a reminder. I cannot run a console program or a service. The IIS
server is locked down. It has to be an asp.net based solution within
the same application. Version 1.1 of framework is used.

Some one out there must have had similar problems to this

Any Help appreciated

No i can't run a task from a different machine. This is the IIS
production server. It won't let a task running on a different machine
attache to an applicaton's cache on it. The entire operation must run
in it's own vurtual web site. There are many other application on
this server belonging to many different business groups. To keep them
all from interfering we are locked into our own vurtual web site and
can't get out or in. No web servers are allowed on this site as yet
anyway.

So far I am trying to get a new thread to run during application start
in the global asa that will sleep for 24 hours and then wake up and
call the cache refresh.

Thanks for the help
Nov 19 '05 #4
Thanks bruce I will look into it.
I have control over the virtual web site but not much else on the
server.

Currently looking at using a new thread to sleep for 24 hours and then
refresh the cache. Not sure how long it will last there. But we will
check it each time a user requests data ..so some may get a very long
wait.

Josef
"bruce barker" <no***********@safeco.com> wrote in message news:<Op**************@TK2MSFTNGP15.phx.gbl>...
if your server is locked down, you need to also check the asp.net timeout,
as this will normally be set. if you site has no activity for a given amount
of time, then the appdomain is unloaded, and you lose all cache items.
usually this means the first person to hit the morning pay the startup cost
(compile, domain load, etc)

-- bruce (sqlwork.com)
"Erick" <jo**********@hotmail.com> wrote in message
news:e1**************************@posting.google.c om...
| i have an asp.net application and I want to save the results of an sql
| query in cache. Because the queries take 28 seconds to run (there are
| twelve similar queries) I want to run it all at 4am, Place the
| results in cache and use those values the rest of the day for all
| users.
|
| I have something like this
|
| CallMe = New Caching.CacheItemRemovedCallback(AddressOf
| Refresh)
| Context.Cache.Insert(CacheKey, SomeObject,Nothing,
| EarlyMornindDateTime), Context.Cache.NoSlidingExpiration,
| Caching.CacheItemPriority.High, CallMe)
|
| The Refresh function in the CallMe object doesn't run when the time
| expires. It runs only if a user request the value in the cache then it
| checks the expiry time and then fires the callback function. Cache is
| refreshed by the first user to acces cache not automatical by the
| system at 4am
|
| Just a reminder. I cannot run a console program or a service. The IIS
| server is locked down. It has to be an asp.net based solution within
| the same application. Version 1.1 of framework is used.
|
| Some one out there must have had similar problems to this
|
| Any Help appreciated

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bite My Bubbles | last post by:
I found the answer! It is a IIS 6 /ASP problem http://support.microsoft.com/default.aspx?scid=kb;en-us;332075
6
by: Tony Proctor | last post by:
Hi everyone We're experiencing some serious anomalies with the scheduling of ASP threads. I'd be interested to hear if anyone knows what algorithm is used (e.g. simple round-robin, or something...
13
by: Mike | last post by:
Normally scheduling a job is a very elementary operation but for some hidden reason I've been unable to schedule a job which runs on a 28 day cycle, even though I have at least 16 other jobs...
3
by: Muscha | last post by:
Hi, In our application we need to have a high performance scheduling framework. We want to be able to say for item 21 do an update on such and such time. We will have around 1 million items of...
1
by: Joe Fallon | last post by:
I am trying to setup a cache that refreshes itself every hour. (My sample code is for every minute so I can test it.) I have found some examples that I thought worked but they all seem to fail....
2
by: Ivan Demkovitch | last post by:
Hi! If I understand caching properly: 1. Create object in cache and set expiration Time to let's say 1 minute 2. Specify delegate which will be called on object expiration. Here we will...
6
by: Charts | last post by:
I used HttpContext.Current.Cache To cache data from database. The code is like that. public static DataView GetCategories() { if ( HttpContext.Current.Cache == null ) {...
11
by: EagleRed | last post by:
I am writing an ASP.NET 2.0 application that uses master pages. I have some pages that must not be cached on the client. In ASP.NET 1.1 I achieved this using metatags: <meta...
0
by: Dinesh | last post by:
Hi , Trying to speed up the cache refresh time.... Assumptions: Configurations in the web.config file are done and also Sqldependency is set between the application and the database table. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.