Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 18, 2012 11:00 AM by cenk1536
Apr 17, 2012 04:32 PM|LINK
There is a web service which pushes dataset (or XML data).I have a web page and I am displaying those data from this dataset on a web page.This web service updates the data occasionally. (not on a periodic basis) There will be approx. 300 users which
will display this web page from different PCs. So here are the questions. Since data is occasionally updated, is it appropriate to use caching? (What kind of cahcing SQL etc) How would I get the updated data and display it on my page? Should I use a timer?
If I use a timer,do I miss the currently updated data? and of course should I store the data in a table?
I would be so grateful if you can help me.
Apr 18, 2012 04:47 AM|LINK
Since data is occasionally updated, is it appropriate to use caching?
Yes. Asp.NET caching( see Cache in asp.net)
Apr 18, 2012 05:39 AM|LINK
Thanks for your reply, what about the other questions? What would you do?
Apr 18, 2012 05:53 AM|LINK
- Cache your data and make the database call after stipulated time (When you feel that data gets updated).
Apr 18, 2012 05:59 AM|LINK
But there is no certain time for the data update. I am planning to implement a timer and check the data lets say for every minute.
Apr 18, 2012 06:11 AM|LINK
Yeah I think this is a good fit for caching..also you would not need to implement a timer..
The Cache object has an overloaded callback parameter, basically a delegate to a method which can be called when the object expires, so either one uses absolute or sliding scale expiration, once the cache expires, the method would be invoked and could be
used to fill back the cache object.
The code sample is explained at the below link
Apr 18, 2012 06:27 AM|LINK
Wouldn't it be more appropriate to use SqlDependency cache? Because I would like to insert those data into a table everytime it is updated. So cache is only flushed when the data changes in the table?
Apr 18, 2012 06:43 AM|LINK
Yes that is another way, I think its used majorly for chatty clients and also there's the setup cost of enabling cache dependency in the database...I have a liking to the Cache object as the control is contained via one system and the call back works efficiently..
Apr 18, 2012 07:10 AM|LINK
How is the data updated? Through the use of the web site or web service? If so, then you could always call a refresh of the cache when the function for updating the data has completed successfully.
Apr 18, 2012 11:00 AM|LINK
I set up a sql cache dependency to sql server 2005. It works OK. But how would I refresh the page everytime the data is updated?