Application cache cache output cache?

I have an application that uses the application cache to store generated responses, but custom HTTP handlers. The same response always returns to requests for the same URL, and the entire response is inserted entirely into the cache.

If an application is cached for each URL, is there an advantage to using the application cache? Or should I just use the output cache?

Note that since I am using a custom HTTP handler, all this is done in C # and not in page directives.

+4
source share
3 answers

Assuming you are not using authorization or using dynamic content, at a lower level you will get better results. The lowest level is kernel mode caching. http://learn.iis.net/page.aspx/154/walkthrough-iis-70-output-caching/

Think about it from an office perspective. Technically, the request chain is: boss, secretary, answering machine and telephone line provider.

Imagine an office without a secretary. The boss must answer every call. This is a script without a cache at all.

The application cache is the secretary. It handles calls, so the boss (application) does not need to answer to repeat the same thing over and over. A secretary is someone who sits between the boss and the outside world. She can handle the simplest scenarios. The boss is worried when there is no secretary at work (low memory).

But the secretary is a person, so she returns home at some time in the evening (the ASPNET application is processed at some time, and the application cache is exposed, therefore, from the ASPNET point of view, the secretary shares the same application with the boss).

An answering machine works here. Not only can he force the secretary to answer stupid questions again and again, he screens the boss when there is no secretary. It's just a machine, and the client listens to a good pre-recorded voice or music (cached item) when neither the secretary nor the boss can answer them.

IIS Caching Mode is an answering machine for your asnet office. An answering machine is much cheaper than a secret one. Itโ€™s just a microcontroller with a tape, it doesnโ€™t even consume coffee, it just plays a cassette or something like that.

Well, it works in one window, but it works much better because it simply performs the simple task of delivering content at maximum speed using its own low-level system resource management.

However, kernel mode is a perceptual way to cache if you have semi-dynamic content in terms of performance.

+1
source

First I will point out the usual warning, which depends on the particular case. Factors such as available web server memory, loading, page size, data size, etc.

However, if there are not a large number of URLs, and they do not have to be very fresh, then there will be an output cache . Especially if you intend to do it publicly, it encourages caching at ISP and browser level. Thus, saving the load on your server and reducing the path for the returned user or a user using the same ISP or proxy.

0
source

I would think that you have to decide whether to configure cache settings programmatically at runtime from your code or not. If you do not, then creating an output cache will be declarative.

0
source

All Articles