Views: 3633 (Data available since 06.02.2017)
Last Modified: 10.10.2012
The "Component Cache" Tab
The Autocache technology exists to prepare the website and the components for stress load conditions, or adapt the website for operation on virtual servers. The Components 2.0 development concept assumes that developers provide explicit autocache technology support in their projects.
To enable or disable autocache, use the Enable Cache (or Disable Cache) button on the Cache Settings page (Settings > System Settings > Cache Settings) page.
when the autocache mode is on, the components whose cache parameter is set to 'Auto + Managed' will use caching.
To take advantage of the new autocache technology, all a non-IT user needs to do is click the button on the Control Panel toolbar in the public section. This will force all the components whose mode is 'Auto + Managed' to create a private cache and use the cache data without issuing excessive database requests.
Whenever you need to refresh the cached data for any reason, do one of the following.
- Open a page whose contents needs to be updated and click Refresh Page Cache on the Control Panel toolbar:
Note that a component whose cache is being reset may be linked to user groups (see the Regard Access Permission option). If this is the case, the cache will be refreshed only for users who are the members of the same user groups as a person initiating cache reset.
If this option is checked, the system uses different cache for different user groups.
Effectively, checking the Regard Access Permission option entails not refreshing the page contents for unregistered visitors.
The Refresh Component Cache command invalidates only the cache of the components that are on a current page, while the Refresh Page Cache command invalidates the whole page.
- When in edit mode, use the cache controls on the component toolbars:
- For an individual component, the cache timeout feature exists. To activate it, simply select the Cache or Auto+Managed cache mode.
- The components may also reset the cache whenever source data changes. To activate it, use the Auto+Managed cache mode.
- Switching to uncached mode resets the cache contents as well.
The components whose cache mode is Auto+Managed invalidate the cache contents automatically on timeout or whenever data changes.
The components whose cache mode is Cache and the cache timeout period is not zero, always operate in cached mode.
The components whose cache mode is Don’t cache or the cache timeout period is zero, always operate in uncached mode.
The "Component Cache" Tab
Use Enable Managed Cache button to activate this feature. Disabling it is not recommended.
The Cache Dependencies technology automatically refreshes the component’s cache whenever source data changes. Therefore, if the managed cache feature is enabled, you will not have to update the cache manually every time you make changes to your website.
not all components support managed cache technology.
The yellow tip below the cache preferences in the component parameters shows the current system settings:
The current implementation of the Сache Dependencies technology is capable of storing the cache in files as well as using Memcached, APC or eAccelerator. To select the required cache storage, edit one of the configuration parameters.
The "HTML Cache" Tab
The controls on this tab allow a system administrator to enable, disable or edit the HTML cache parameters.
|Inclusion mask||Specifies the files that will be controlled by the HTML cache.|
|Exclusion mask||Specifies the files to avoid when building and managing the HTML cache.|
|Disk quote||Specifies the maximum cache size, in MB.|
Important! It is not recommended that you enable HTML cache if your system contains Web Analytics or Advertising modules.
HTML cache works best for rarely updated sections available to anonymous visitors because:
- the HTML cache engine processes only the pages matching the inclusion mask;
- whenever an authorized visitor hits one of those pages, the engine looks up the cache for this page and, if the latter is found, shows the cached page without querying any of the underlying modules, components or database records. In practice, it means that such visits will not be recorded in statistics and no proper advertisement will be shown;
- if the Compression module was active when creating the page’s cached version, the page will be transferred to the client in compressed form;
- if the engine cannot find the page in the cache, the page will be executed in normal mode and the output will be added to the cache.
The cache is purged completely or partially:
- if the new cache size exceeds the specified quota – the cache is deleted completely;
- if any change occurs in Control Panel – the cache is deleted completely;
- if a POST request occurs in public section – the corresponding cache portion is deleted.
To summarize the HTML cache features:
- no statistics collection occurs;
- the advertising module is called only when a page does not exist in cache and needs to be created (this does not include external banners like GoogleAds etc.);
- you must specify the disk quota to prevent DDoS attacks;
- once the HTML cache engine is enabled, you must double-check the whole section to which the HTML cache is applied (for example, you may encounter problems adding comments if outdated blog templates was used when creating the cache).
The "Delete Cache Files" Tab
Use this tab to delete outdated or faulty cache data.
|Only outdated||Deletes the pages whose lifetime expired.|
|All||Deletes the cache completely.|
|Menu||The menus may become redundantly cached when checking the menu links for validity. This option deletes such menu data. |
|All managed cache||Deletes all files in /bitrix/managed_cache/.|
|All pages in HTML cache||Deletes all pages from the HTML cache.|
Once the cache has been purged, the newly requested data will be actualized and added to the cache.