barcode library c# CACHING AND PERFORMANCE TUNING in Font

Create ANSI/AIM Code 39 in Font CACHING AND PERFORMANCE TUNING

CHAPTER 12 CACHING AND PERFORMANCE TUNING
Printing Code 3 Of 9 In None
Using Barcode generation for Font Control to generate, create Code-39 image in Font applications.
www.OnBarcode.com
Paint Code 39 Extended In None
Using Barcode drawer for Font Control to generate, create Code 39 image in Font applications.
www.OnBarcode.com
There is another way that items are removed from a cache. Because a cache is just a block of memory (and therefore not infinite in size), there is a cache management mechanism that prevents the cache from filling up with nonexpired items. The way it does this is to examine the priority of all the items in the cache and remove those with the lowest priority to make way for new items. An item s priority is set at the same time as its expiration, at the time the item is generated and cached. The expiration setting and priority chosen depend very much on the type of data and the context (you ll see an example later in this chapter, in the Data Caching section).
PDF 417 Drawer In None
Using Barcode generation for Font Control to generate, create PDF-417 2d barcode image in Font applications.
www.OnBarcode.com
Draw GTIN - 12 In None
Using Barcode generator for Font Control to generate, create GTIN - 12 image in Font applications.
www.OnBarcode.com
Cache Locations
Encoding Barcode In None
Using Barcode generation for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
ANSI/AIM Code 128 Printer In None
Using Barcode maker for Font Control to generate, create ANSI/AIM Code 128 image in Font applications.
www.OnBarcode.com
In the web architecture, a cache can reside in a number of different places, and it makes sense to cache different types of content in different places. To be more specific, consider that, in general, a request/response is generally made either directly between the web client (the browser) and the web server, or indirectly via a proxy server, as shown in Figure 12-12.
Draw Barcode In None
Using Barcode creator for Font Control to generate, create Barcode image in Font applications.
www.OnBarcode.com
Code 11 Generator In None
Using Barcode printer for Font Control to generate, create Code11 image in Font applications.
www.OnBarcode.com
Figure 12-12. A request/reponse may go through a proxy server. This, in fact, gives you three different places where you can cache content: the client (browser), the proxy server, and the web server. The implications of storing content in a cache depend on which cache location is used. Let s examine each one in turn. Caching at the Client (Browser) Any browser has a local cache, which it can use for temporary storage of any received resources that are marked as cacheable by the content author. When a user requests the same resource a second time, the browser will check the local cache. If the resource is still there (that is, it has not expired or been removed), the browser will fetch the resource from the local cache, rather than fetching it from the server. The obvious advantage of this situation is that it provides zero latency, because the cached resource can be displayed immediately by the browser without the need to establish a connection and wait for a response. This is as fast as it gets! It also reduces the overall number of necessary transmissions of requests and responses over the network, and hence saves bandwidth. Finally, if the original resource required server resources to generate it, it saves the server the trouble of repeating that work, so there s an overall reduction in demand on the server. These are compelling benefits, and it s easy to conclude that browser caching seems like an ideal option. But it s not ideal in all situations. One reason is that some browsers choose not to honor the caching attributes specified by the page s author. Another is that if the user
Code 39 Maker In None
Using Barcode printer for Online Control to generate, create USS Code 39 image in Online applications.
www.OnBarcode.com
Code 39 Maker In None
Using Barcode generation for Software Control to generate, create Code 3 of 9 image in Software applications.
www.OnBarcode.com
CHAPTER 12 CACHING AND PERFORMANCE TUNING
UPC Code Generation In None
Using Barcode creator for Software Control to generate, create UPC-A image in Software applications.
www.OnBarcode.com
GS1-128 Recognizer In VB.NET
Using Barcode scanner for .NET Control to read, scan read, scan image in .NET framework applications.
www.OnBarcode.com
has specified any different settings on their browser, these settings will override the default behavior. (For example, users of Internet Explorer can control the browser s internal cache by selecting Tools Internet Options, and then clicking the Settings button.) It s important to realize that caching a page at the browser means that there s a copy of the cached item stored on the user s local machine. There are potential security and privacy implications here, because it s possible for other users of the same machine to access these resources. In particular, it would be irresponsible to code your application to cache sensitive information such as bank account information at the browser (or, indeed, at the proxy server, as you ll see in the next section). Caching at the Proxy Server As illustrated in Figure 12-12, a proxy server is a machine that sits between the web application server and the client machines, acting as an intermediary. It receives requests from client machines and forwards these requests to the origin server. It also receives the responses from the origin server and passes them back to clients. When a proxy server receives a resource from a server, it checks to see whether the page author has deemed the resource to be cacheable at the proxy server (something we ll look at when we discuss ASP .NET page caching in the next section). If so, the proxy server can store the page in its own local cache. The benefits of caching at the proxy are similar to those for caching at the browser. In particular, if the same resource is requested again (either by the same user or by another user via the same proxy server), the proxy server is able to deliver the resource from its own cache, rather than by passing the request on to the server. This saves on the server s resources and bandwidth, and reduces response time in much the same way. Note that the saving is less significant; for example, you get reduced latency but not zero latency. To reduce latency of the cached request to a minimum, the proxy server is usually located close to the client machine. On the other hand, a resource cached on a proxy server can be used to serve the requests of the hundreds (or thousands) of users whose requests are handled by that proxy server, regardless of the identity of the user who requested it first. Proxy servers are usually put in place by ISPs and corporations with many users. As a consequence, you (as an application developer) generally don t have any control over the existence (or otherwise) of a proxy server. Therefore, while it s useful to take advantage of the possibility of proxy server caching, it is not something you can depend on. Caching at the Origin Server Of course, caching content on the server doesn t get the content any closer to the client. If the web server chooses to use its own cache to serve a request, the content still needs to be transmitted back across the network, just as if it were freshly generated. Therefore, there are no savings in latency and bandwidth to be made from caching at the server. However, caching at the server still allows you to reuse resources, avoiding unnecessary regeneration of those resources, and hence reducing the server s workload. While caching at the server doesn t look as attractive as caching at the client or proxy server, it is sometimes your only option, particularly when security and privacy issues are involved. Ultimately, these three types of caching can help you save resources and get better performance. How much bandwidth and workload can you save How much is latency reduced
Scanning PDF 417 In None
Using Barcode recognizer for Software Control to read, scan read, scan image in Software applications.
www.OnBarcode.com
European Article Number 13 Scanner In .NET Framework
Using Barcode decoder for .NET framework Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
Printing Barcode In Java
Using Barcode printer for Java Control to generate, create Barcode image in Java applications.
www.OnBarcode.com
Make EAN13 In None
Using Barcode printer for Excel Control to generate, create European Article Number 13 image in Excel applications.
www.OnBarcode.com
Painting Linear In .NET
Using Barcode encoder for .NET Control to generate, create Linear Barcode image in Visual Studio .NET applications.
www.OnBarcode.com
UPC-A Drawer In Java
Using Barcode drawer for Java Control to generate, create UPC Code image in Java applications.
www.OnBarcode.com
Barcode Scanner In .NET
Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications.
www.OnBarcode.com
Scanning Code 39 Extended In None
Using Barcode scanner for Software Control to read, scan read, scan image in Software applications.
www.OnBarcode.com
Copyright © OnBarcode.com . All rights reserved.