473,770 Members | 6,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cache and Carry

If anyone can chime in on these questions, I'd sure appreciate it.

1. How does the cache block fit in with the UIP Block - Is the "state"
managed there handled any differently with the CAB included? Do they
coexist?

2. Is Singleton the kind of default storage method relating to application
wide memory - Is it different in web vs Win apps?

3. Should we just use the ASPNET cache for web apps and the CAB for Win
apps?

4. What's the advantage of using SQL Server as a cache since you still have
to hit the database....jus t to aviod multiple processing of data?

5. Is the CAB only for "smart clients" and not for WinForm apps?

6. ASPNET cache - saved on server and available application wide? How does
it differentiate between sessions. Must the cache data saved only pertain
to global type information?

7. Can the CAB update cached items? I was under the impression that when the
data in cache got stale, you'd simply flush the cache and reload with all
new data results. A co-worker said he thought the cache itself should be
updateable ie individual records within the cache updated....cour se if you
did that the original database would not be synced....
Nov 18 '05 #1
2 1817
Hi Harry:

I'm afraid I'm not extremely familiar with the UIP/CAB blocks, but I
know you've asked before and have not gotten an answer, so let me
throw in two cents on some questions.. (see inline)

On Wed, 25 Aug 2004 10:09:52 -0500, "Harry Simpson"
<hs*******@nosp amphgt.net> wrote:
If anyone can chime in on these questions, I'd sure appreciate it.

1. How does the cache block fit in with the UIP Block - Is the "state"
managed there handled any differently with the CAB included? Do they
coexist?

2. Is Singleton the kind of default storage method relating to application
wide memory - Is it different in web vs Win apps?

With a singleton you should have only one instance of a class for the
entire application to access. This is true for both web apps and
WinForms. A cache is generally implemented as a singleton.
3. Should we just use the ASPNET cache for web apps and the CAB for Win
apps?
If you are writing a class library that needs to work in both web and
WinForm applications, the best approach is to abstract away where you
are caching the data. Encapsulate the details of where the cached data
is actually 'stored into' and 'retrieved from' in a class. This is
essentially what the CAB provides.

4. What's the advantage of using SQL Server as a cache since you still have
to hit the database....jus t to aviod multiple processing of data?

It does depend on the application and what the application does. If
you cache the results of 60 seconds of computation into a single row
in the database then SQL caching might be a huge win. In other cases
SQL caching might slow an application down. This is one of those areas
where you need to measure and test in a specific environment with an
application.

Also not that a SQL Server on the local machine might be faster than a
remote server. It would avoid the network hop. It could also use the
shared memory provider and avoid the TCP/IP stack altogether. Again,
this is something that has to be tested and measured for a specific
app to make sure it's an overall win.
5. Is the CAB only for "smart clients" and not for WinForm apps?

No, I believe it can be used anywhere.
6. ASPNET cache - saved on server and available application wide? How does
it differentiate between sessions. Must the cache data saved only pertain
to global type information?

ASPNET cache is saved on the server and is application wide. It does
not differentiate between sessions - all users will see the same
result for a given cache key unless the underlying data changes.

You can store per-user data in the cache, but you'll need to be
careful. You could, for example, prefix the cache key with a user ID
of some sort to ensure each user only sees thier copy of the cached
data.
7. Can the CAB update cached items? I was under the impression that when the
data in cache got stale, you'd simply flush the cache and reload with all
new data results. A co-worker said he thought the cache itself should be
updateable ie individual records within the cache updated....cour se if you
did that the original database would not be synced....


HTH,

--
Scott
http://www.OdeToCode.com

Nov 18 '05 #2
Scott,

That really did help! Really glad to get a response. I've been unable to
get another point of view from the Cache Block site itself....seemi ngly the
place to get such a response eh.

I form an eval in my head and your responses confirm some of the ideas I
had.
Again, Thanks!

Harry

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:i1******** *************** *********@4ax.c om...
Hi Harry:

I'm afraid I'm not extremely familiar with the UIP/CAB blocks, but I
know you've asked before and have not gotten an answer, so let me
throw in two cents on some questions.. (see inline)

On Wed, 25 Aug 2004 10:09:52 -0500, "Harry Simpson"
<hs*******@nosp amphgt.net> wrote:
If anyone can chime in on these questions, I'd sure appreciate it.

1. How does the cache block fit in with the UIP Block - Is the "state"
managed there handled any differently with the CAB included? Do they
coexist?

2. Is Singleton the kind of default storage method relating to application
wide memory - Is it different in web vs Win apps?


With a singleton you should have only one instance of a class for the
entire application to access. This is true for both web apps and
WinForms. A cache is generally implemented as a singleton.
3. Should we just use the ASPNET cache for web apps and the CAB for Win
apps?


If you are writing a class library that needs to work in both web and
WinForm applications, the best approach is to abstract away where you
are caching the data. Encapsulate the details of where the cached data
is actually 'stored into' and 'retrieved from' in a class. This is
essentially what the CAB provides.

4. What's the advantage of using SQL Server as a cache since you still
have
to hit the database....jus t to aviod multiple processing of data?


It does depend on the application and what the application does. If
you cache the results of 60 seconds of computation into a single row
in the database then SQL caching might be a huge win. In other cases
SQL caching might slow an application down. This is one of those areas
where you need to measure and test in a specific environment with an
application.

Also not that a SQL Server on the local machine might be faster than a
remote server. It would avoid the network hop. It could also use the
shared memory provider and avoid the TCP/IP stack altogether. Again,
this is something that has to be tested and measured for a specific
app to make sure it's an overall win.
5. Is the CAB only for "smart clients" and not for WinForm apps?


No, I believe it can be used anywhere.
6. ASPNET cache - saved on server and available application wide? How does
it differentiate between sessions. Must the cache data saved only pertain
to global type information?


ASPNET cache is saved on the server and is application wide. It does
not differentiate between sessions - all users will see the same
result for a given cache key unless the underlying data changes.

You can store per-user data in the cache, but you'll need to be
careful. You could, for example, prefix the cache key with a user ID
of some sort to ensure each user only sees thier copy of the cached
data.
7. Can the CAB update cached items? I was under the impression that when
the
data in cache got stale, you'd simply flush the cache and reload with all
new data results. A co-worker said he thought the cache itself should be
updateable ie individual records within the cache updated....cour se if you
did that the original database would not be synced....


HTH,

--
Scott
http://www.OdeToCode.com

Nov 18 '05 #3

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

Similar topics

3
1562
by: Nel | last post by:
Hi! I am trying to prevent a browser going back to a logon screen and any user being able to refresh (and the browser re-submits the post data). I understand that the following should work. It doesn't. header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); header("Expires: Mon,26 Jul 1997 05:00:00 GMT");
11
30422
by: shank | last post by:
Is it possible to stop 1 single form field from being cached? I would like all the name and address fields to be cached by Internet Explorer, but not the credit card field. How is that done? thanks
0
1414
by: Bryan Parkoff | last post by:
I break one U_WORD variable into two U_BYTE variables. I prefer to manipulate two U_BYTE variables instead of one U_WORD variable using Carry. Please look at my example using U_WORD variable below. typedef unsigned char U_BYTE; typedef unsigned short int U_WORD; U_WORD HighLow = 0x00FE; HighLow += 0x04; U_BYTE Carry = HighLow >> 8;
16
4061
by: archilleswaterland | last post by:
Hi, I am using a compiler that does not support long int (32 bits) so I am using 2 int's to do the work my problem int a; int b; int c;
3
2851
by: martin | last post by:
Hi, I am storing a dataset in cache, which is happening fine. I can easily retrive it at postback from the cache, cast it to a dataset and reuse it. However I have specified that the cache expire in 5 minutes like so. If Not IsPostBack Then BindMyDropDown() Else Response.Write("<hr>Cache Expires 5 minutes" &
14
2097
by: Tom.PesterDELETETHISSS | last post by:
Hi, I think this question requires an in depth understanding of how a browser cache works. I hope I can reach an expert here. I may have found a quirk in the asp.net documentation or I don't understand what the SetAllowResponseInBrowserHistory does. While researching caching I tried the code sample at the following page : http://msdn2.microsoft.com/library/97wcd0a4(en-us,vs.80).aspx
5
3948
by: campbellbrian2001 | last post by:
I'm trying to get the "Carry data over to new record" code to work from Allen Browne's site: http://allenbrowne.com/ser-24.html I follwed the instruction explicitly and somethings not working... any clues? Thanks all!! Brian
17
5178
by: Hugh | last post by:
I would like to perform an addition without carrying of two integers... I've got no idea how to do this in python, although I've been using it for web/cgi/db work for a few years now. Any help would be great. Hugh
3
2179
chunk1978
by: chunk1978 | last post by:
hi there... i'm trying to make one text field contain the value of another... i'm assuming there's a really simple solution... here's a code i quickly wrote to further explain my issue: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10005
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
9871
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
8887
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...
0
6679
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
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.