TAILIEUCHUNG - ASP.NET 4 Unleased - p 137

Caching Các trang ứng dụng và dữ liệu Các hoạt động chậm nhất mà bạn có thể thực hiện trong một Trang là cơ sở dữ liệu truy cập. Mở một kết nối cơ sở dữ liệu và lấy dữ liệu là một hoạt động chậm. Cách tốt nhất để cải thiện hiệu suất của mã truy cập dữ liệu của bạn không để truy cập vào cơ sở dữ liệu ở tất cả. | This page intentionally left blank From the Library of Wow eBook CHAPTER 29 Caching Application Pages and Data T he slowest operation that you can perform in an page is database access. Opening a database connection and retrieving data is a slow operation. The best way to improve the performance of your data access code is not to access the database at all. By taking advantage of caching you can cache your database records in memory. Retrieving data from a database is slow. Retrieving data from the cache on the other hand is lightning fast. In this chapter you learn about the different caching mechanisms supported by Framework which provides you with an overwhelming number of caching options. We attempt to clarify all these caching options over the course of this chapter. In the final section of this chapter you learn how to use SQL Cache Dependencies which enable you to reload cached data automatically when data changes in a database table. You learn how to use both polling and push SQL Cache Dependencies. IN THIS CHAPTER Overview of Caching Using Page Output Caching Using Partial Page Caching Using DataSource Caching Using Data Caching Using SQL Cache Dependencies Summary Overview of Caching The 4 Framework supports the following types of caching Page Output Caching Partial Page Caching DataSource Caching Data Caching From the Library of Wow eBook 1336 CHAPTER 29 Caching Application Pages and Data Page Output Caching enables you to cache the entire rendered contents of a page in memory everything that you see when you select View Source in your web browser . The next time that any user requests the same page the page is retrieved from the cache. Page Output Caching caches an entire page. In some situations this might create problems. For example if you want to display different banner advertisements randomly in a page and you cache the entire page the same banner advertisement displays with each page request. NOTE The AdRotator control .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.