473,797 Members | 3,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.CacheIt emRemovedCallba ck(AddressOf
Refresh)
Context.Cache.I nsert(CacheKey, SomeObject,Noth ing,
EarlyMornindDat eTime), Context.Cache.N oSlidingExpirat ion,
Caching.CacheIt emPriority.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 4371
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**********@h otmail.com> wrote in message
news:e1******** *************** ***@posting.goo gle.com...
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.CacheIt emRemovedCallba ck(AddressOf
Refresh)
Context.Cache.I nsert(CacheKey, SomeObject,Noth ing,
EarlyMornindDat eTime), Context.Cache.N oSlidingExpirat ion,
Caching.CacheIt emPriority.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**********@h otmail.com> wrote in message
news:e1******** *************** ***@posting.goo gle.com...
| 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.CacheIt emRemovedCallba ck(AddressOf
| Refresh)
| Context.Cache.I nsert(CacheKey, SomeObject,Noth ing,
| EarlyMornindDat eTime), Context.Cache.N oSlidingExpirat ion,
| Caching.CacheIt emPriority.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.r illing.net> wrote in message news:<ey******* *******@tk2msft ngp13.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**********@h otmail.com> wrote in message
news:e1******** *************** ***@posting.goo gle.com...
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.CacheIt emRemovedCallba ck(AddressOf
Refresh)
Context.Cache.I nsert(CacheKey, SomeObject,Noth ing,
EarlyMornindDat eTime), Context.Cache.N oSlidingExpirat ion,
Caching.CacheIt emPriority.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******* *******@TK2MSFT NGP15.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**********@h otmail.com> wrote in message
news:e1******** *************** ***@posting.goo gle.com...
| 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.CacheIt emRemovedCallba ck(AddressOf
| Refresh)
| Context.Cache.I nsert(CacheKey, SomeObject,Noth ing,
| EarlyMornindDat eTime), Context.Cache.N oSlidingExpirat ion,
| Caching.CacheIt emPriority.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
32842
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
2328
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 more sophisticated), and what situations might perturb it. Even a hint as to what would be considered normal scheduling might help. The root of our problem is that we observed a normally well-behaved web application suddenly limit itself to a...
13
6061
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 seperately scheduled to run on a 28 day cycle with different start dates/times. My production SQL server is running SQL Server Enterprise Edition 8.00.760(SP3) on a 2 Processor(4 virtual) Microsoft
3
2892
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 this kind with different scheduling time, so not all will be updated per hour. Some will be per hour some will be once every 2 weeks. Does anyone has any suggestion how to tackle this problem? Oh and one of the requirement is that we are not...
1
2509
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. (They only work when I click the submit button - not when the cache expires.) In my Login form I have: Global.AddItemToCache("CacheTime", Date.Now, 60)
2
1102
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 restore object and do some other stuff. Basically we have timer-like application which lives by itself without user's hitting website.
6
1991
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 ) { HttpContext.Current.Cache = GetCategoriesFromDB(); } return (DataView)HttpContext.Current.Cache;}
11
12129
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 http-equiv="Expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Cache-Control" content="no-cache"> This tags are part of the <headelement. Sample code that I have seen shows how to add metatags of the form:
0
1251
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. Actual Flow: Whenever I do some manipulations(insert,update) on the the
0
10246
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10209
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10023
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9066
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7560
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3750
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.