在 SharePoint Server 中的快取設定操作Cache settings operations in SharePoint Server

摘要:了解可用的快取及可設定 BLOB 快取與快取設定檔的設定與 SharePoint Server 2016 和 SharePoint Server 2013 中的物件快取設定。Summary: Learn about the available caches and the settings that can be configured for the BLOB cache and cache profiles and object cache settings in SharePoint Server 2016 and SharePoint Server 2013.

SharePoint Server 提供四種快取類型來協助改善瀏覽器中網頁載入的速度: BLOB 快取、 頁面輸出快取、 物件快取和匿名搜尋結果快取。BLOB 快取已啟用並設定您要套用的快取的 web 應用程式中的 Web.config 檔案中。頁面輸出快取及物件快取 areis 通常是設定在使用者介面在網站集合層級。這些快取的特定設定也可以設定 web 應用程式層級。對 Web.config 檔案所做的變更會套用至所有網站集合與 web 應用程式內的網站並將會取代任何網站集合層級或下方所做的設定。SharePoint Server provides four types of caches that help improve the speed at which web pages load in the browser: the BLOB cache, the page output cache, the object cache, and the anonymous search results cache. The BLOB cache is enabled and configured in the Web.config file in the web application to which you want to apply the cache. The page output cache and object cache areis usually configured in the user interface at the site collection level. Certain settings for these caches can also be configured at the web application level. The changes that you make to the Web.config file will be applied to all site collections and sites within the web application, and will supersede any configuration made at the site collection level or below.

注意

若要使用網頁輸出快取或物件快取,您必須使用網站上的發佈功能。To use the page output cache or the object cache, you must be using the Publishing feature on your site.

BLOB 快取BLOB cache

SharePoint Server 提供可儲存網頁用以協助他們在瀏覽器] 快速載入並減少資料庫伺服器上的負載時使用這些檔案的檔案的磁碟快取。這些檔案稱為二進位大型物件 (Blob) 和 「 快取 」 稱為 「 BLOB 快取。BLOB 快取儲存直接在前端網頁伺服器電腦的硬碟上。第一次呼叫網頁,這些檔案從資料庫複製到伺服器硬碟上的快取和那些檔案的所有後續要求然後會回應來自伺服器的硬碟機快取。根據預設,BLOB 快取關閉,且必須啟用使用它所提供的功能。當您在前端網頁伺服器上啟用 BLOB 快取時,您會減少從網頁瀏覽器讀取要求所建立的 SharePoint Server 資料庫伺服器上的負載。SharePoint Server provides a disk-based cache that stores files that are used by web pages to help them load quickly in the browser, and reduces the load on the database server when it uses those files. These files are known as binary large objects (BLOBs), and the cache is known as the BLOB cache. The BLOB cache is stored directly on the hard disk drive of a front-end web server computer. The first time that a web page is called, these files are copied from the database to the cache on the server hard disk drive, and all subsequent requests for those files are then served from the hard disk drive cache of the server. By default, the BLOB cache is off and must be enabled to use the functionality it provides. When you enable the BLOB cache on your front-end web server, you reduce the load on the SharePoint Server database server created by read requests from web browsers.

啟用 BLOB 快取在 Web.config 檔案中您要套用它的 web 應用程式。對 Web.config 檔案所做的變更會套用至 web 應用程式內的所有網站集合。如需 BLOB 快取資訊,請參閱規劃快取及 SharePoint Server 中的效能You enable the BLOB cache in the Web.config file of the web application to which you want to apply it. The changes that you make to the Web.config file will be applied to all site collections within the web application. For information about the BLOB cache, see Plan for caching and performance in SharePoint Server.

網頁輸出快取設定檔Page output cache profiles

網頁輸出快取會儲存轉譯的網頁輸出。此快取也可依據要求網頁的使用者權限,儲存已快取網頁的不同版本。網頁輸出快取定可以設定在網站集合層級上、網站層級上,以及設定用於頁面配置。根據預設,網頁輸出快取為關閉。The page output cache stores the rendered output of a page. It also stores different versions of the cached page, based on the permissions of the users who are requesting the page. Page output cache settings can be configured at the site collection level, at the site level, and for page layouts. By default, the page output cache is turned off.

網頁輸出快取會使用快取設定檔來指定在快取中應該保留項目的時間長度。您可以指定不同的快取設定用於匿名和已驗證的使用者,依據網站所允許的驗證方法,藉此最佳化快取使用方式。The page output cache uses cache profiles that specify how long items should be held in the cache. You can specify different cache profiles to be used for anonymous and authenticated users, which optimizes the use of the cache based on the authentication methods that are allowed on the site.

您可以編輯應用程式伺服器上的 Web.config 檔案,為 Web 應用程式設定快取設定檔設定。您設定在 Web 應用程式層級上的快取設定檔設定,將會針對該 Web 應用程式用於網站集合中的所有快取設定檔。You can configure cache profile settings for a web application by editing the Web.config file on the application server. The cache profile settings that you configure at the web application level will be used for all cache profiles in the site collections for that web application.

注意

有內容搜尋網頁組件的已知的問題。在 [網頁組件中的 SendContentBeforeQuery 設定不適用於正確使用輸出快取的頁面。在 SharePoint Server 2013 累計更新 3 月 2013 解決這個問題。如需詳細資訊,請參閱 Microsoft 知識庫文章 2767999:說明 SharePoint Server 2013 更新: 2013 年 3 月 12 日There is a known issue with the Content Search Web Part. The SendContentBeforeQuery setting in the Web Part does not work correctly on pages that use output caching. This issue is resolved in the SharePoint Server 2013 cumulative update for March 2013. For more information, see Microsoft Knowledge Base article 2767999: Description of the SharePoint Server 2013 update: March 12, 2013.

注意

若要使用網頁輸出快取和相關的快取設定檔設定,您必須使用網站上的發佈功能。To use the page output cache and the associated cache profile settings, you must be using the Publishing feature on your site.

物件快取Object cache

物件快取減少的網頁伺服器與 SQL 資料庫之間的流量由儲存物件 — 例如清單與文件庫、 網站設定],及版面配置 — 前端網頁伺服器電腦上的記憶體中。因此,需要這些項目頁面可轉譯快速地增加與頁面會傳遞至用戶端瀏覽器的速度。在 web 應用程式層級,並在網站集合層級可設定物件快取設定。預設物件快取是在網站集合層級。The object cache reduces the amount of traffic between the web server and the SQL database by storing objects —such as lists and libraries, site settings, and page layouts —in memory on the front-end web server computer. As a result, the pages that require these items can be rendered quickly, increasing the speed with which pages are delivered to the client browser. Object cache settings can be configured at the web application level, and at the site collection level. By default, the object cache is on at the site collection level.

您可以指定物件快取的大小藉此最佳化 Web 應用程式的物件快取。指定較大的數字可以透過每部前端網頁伺服器上的記憶體,強化部分大型網站的效能。您可以針對網站集合層級上的物件快取設定其他設定。You can optimize the object cache for a web application by specifying the size of the object cache. Specifying a larger number can enhance performance for some large sites at the cost of memory on each front-end web server. You can configure other settings for the object cache at site collection level.

注意

若要使用物件快取,您必須使用網站上的發佈功能。To use the object cache, you must be using the Publishing feature on your site.

匿名搜尋結果快取Anonymous search results cache

匿名搜尋結果快取主要是由允許匿名使用者存取的發佈網站使用。此快取會儲存來自匿名使用者的搜尋結果,並重複使用這些結果以供稍後與原始查詢相同的查詢使用。如此可改善使用內容搜尋網頁組件之網站頁面的效能。The anonymous search results cache is primarily used by publishing sites that allow access to anonymous users. It saves search results from anonymous users and reuses them for later queries that are the same as the original query. This improves performance on site pages that use the Content Search Web Part.

注意

沒有在其內容搜尋網頁組件和目錄項目重複使用網頁組件不要使用匿名搜尋結果快取類別頁面的已知的問題。在 SharePoint Server 2013 累計更新 3 月 2013 解決這個問題。如需詳細資訊,請參閱 Microsoft 知識庫文章 2767999:說明 SharePoint Server 2013 更新: 2013 年 3 月 12 日There is a known issue in which Content Search Web Part and the Catalog-Item Reuse Web Part do not use the anonymous search results cache on category pages. This issue is resolved in the SharePoint Server 2013 cumulative update for March 2013. For more information, see Microsoft Knowledge Base article 2767999: Description of the SharePoint Server 2013 update: March 12, 2013.

注意

若在安裝累計更新前已安裝類別頁面,則必須重新建立類別頁面。請在要保留的原始類別頁面上儲存配置及任何自訂。中斷連線再重新連線類別,然後將自訂複製到新的類別頁面。If you have category pages that you created before the cumulative update was installed, you must re-create the category pages. Save the layouts and any customizations on the original category pages that you want to keep. Disconnect and then reconnect to the catalog, and then copy the customizations to the new category pages.

快取設定的相關文章Articles about cache settings

快取設定相關的下列文章所提供。The following articles about cache settings are available.

另請參閱See also

概念Concepts

在 SharePoint Server 中規劃快取及效能Plan for caching and performance in SharePoint Server

在 SharePoint Server 2016 中監視快取效能Monitor cache performance in SharePoint Server 2016