Configure a Full Page Cache

Full Page Cache extension has rich set of options, that allows you to tune-up your Cache. It breaks into two large groups, which also have subsections:

Pick a section to know more.


General Settings

Option Description
Enabled Enables full page cache. You can enable/disable full page cache for each store view separately, using Store Switcher.
Cache Lifetime (sec) Cache lifetime (in seconds). Determines the time after which the page cache will be invalid. A new page cache will be created the next time a visitor visits the page.
Flush Cache Expr Specifies how often cron should clear (flush) cache. Leave empty for disable this feature.
Max. Cache Size (Mb) Defines maximum full page cache size in megabytes. Note: If the limit is reached, extension will clear cache.
Max. Number of Cache Files Defines maximum number of cache files. Note: If the limit is reached, extension will clear cache.
Gzcompress Level Compress the cache. Use only for filecache. Flush Fpc cache after changing.
Cache Level Defines caching level. Default - refresh cache if visible product changed. Minimal set of tags and Minimal set of tags with custom prefix - create minimal set of tags and use observer to flush cache. Don't use tags - don't create product and category tags. Flush Fpc cache after changing.
In most cases Minimal set of tags with custom prefix is recommended.

Cache Rules

  • Max. Allowed Page Depth - determines the number of layered navigation filters, or parameters, that can be applied in order for a page to be cached.

  • Cacheable Actions - list of cacheable actions. Read more:

    Basically, the structure of the cacheable action: [module_name]/[controller_name]_[action_name]

    Cacheable Action examples:

    • cms/index_index - home page
    • cms/page_view - all cms pages (but not for home page)
    • catalog/product_view - product view page
    • catalog/category_view - category view page/product list page

      In most cases, you can see what expression to use via HTML code. For example, to know what expression you should use to make cacheable Home page, you need to inspect body class of your store home page. As we can see, body class="cms-index-index" can be added to the cacheable list as: cms/index_index picture

  • Ignored Pages - list of not eligible for caching pages. Read more:

    For example we have a store page: http://www.example.com/apparel/shoes.html To exclude from cache page apparel/shoes.html, you need to add this line: /apparel\/shoes.html/ to the Ignored Pages list. To exclude from cache all pages which contain apparel, you need to add a new line: /apparel/. If you add line /gclid/ to the Ignored List, extension will not cache all pages which contain gclid in the URLs, where ?gclid= - Google Click Identifier.

  • User Agent Segmentation - determines the cache by user agent. How to setup User Agent Segmentation:

    Go to System > Configuration > Design. The 2nd box down should be Themes, open it and if it is setup like the Magento default your existing theme will be set as the Default value. Click the Add Exception button. It allows to enter a Matched Expression which Magento will compare with the browsers user agent and if it matches, it will display the theme specified in the Value box. You can enter as many expressions as you like, separated by a pipe symbol (|), depending on which devices you want to target. To target the most popular devices such as Android and iPhones, the following code will work: agent_seg1.png Now you need to target these devices. Go to System > Configuration > Mirasvit Extensions > Full Page Cache and open Cache Rules block. Set Cache group for each segment. Use slashes to specify User Agent: /agent example/. After all changes Flush Magento Cache.

    agent_seg2.png

  • Ignored Url Parameters - allows you to use same cache for pages with same base URL, but different GET parameters. Read more:

    Store pages often can be referenced from other stores, catalogs and social networks, which can add to URL of that pages certain GET parameters. For example, if you will share https://store.com/product.html via email, when customer clicks on it, the actual URL will be https://store.com/product.html?utm_medium=email. Parameter utm_medium is called reference mark and used in automated traffic and marketing analysis.

    Technically, both of above URLs point to the same page with same information, but cache treats them as different pages (since URL's are different) and creates two cached pages. If you have extensive store structure, it can increase cache size - since each page will be cached multiple times.

    Our extension can analyze GET parameters, search for enlisted parameter marks (like utm_medium) before cache request, and remove them for requested URL. This makes cache create only one cached page, and use it whenever customer clicks on a link with marks. It will dramatically reduce cache size.

    If you use this feature, and enable System -> Configuration -> Mirasvit Extensions -> Full Page Cache -> Show Time Stats, you can see ignored parameters for a particular page, as shown below.

    ignored_url_params.png

    Stores also can use GET parameters for dynamically generated pages - such as filtering catalog sections with price parameter. If you will include such parameters to Ignored Url Parameters list, it will break store functionality. Here is the list of parameters, which should not be enlisted:

    • price
    • limit
    • dir
    • order
    • mode

    Latest versions of our extensions ignore such parameters, even when they are enlisted, but some of old versions can still allow them.

  • Use Mobile Detect - Determines the cache by device type.

Extended setting (for most part of stores should be default)

Option Description
Clean old cache Clear old cache (expired cache) by cron. Sometimes if Magento cron job has not enough permissions for this operation, it will flush all cache. If you see such situation, you need to run Magento cron job from user with more permissions or set 'No' for this configuration.
Update headers for cached pages If disabled add only FPC cache Id in headers and don't update other headers from cache. For most part of stores should be enabled.
Update cart method Update cart method. In most situation should be "Default". If you have any problem with cart set "Whole page" and refresh all cache.
Add all tags for home page If enabled will add maximum tags for home page. Sometimes it is need for blocks update.
Use session for specified block If disabled ignore in_session parameter in cache.xml file and don't use session for such blocks.
Use the same cache for all groups If enabled create the same cache for all customer groups. Can be enabled only if you use the same price for all custome groups.
Update stock method In most situation should be "Default". Default - update stock using event "cataloginventory_stock_item_save_commit_after". Default (check stock in frontend) - check stock in frontend. Update during reindex (Cache Level should be Default) - update stock after product save and reindex.
Delete ignored url params for layered navigation Removes from Layered Navigation URLs, that should be ignored. For most cases should be No.
Html pattern Uses a special pattern for block excluding from caching. Should be Default in most cases. Read more at How to add custom dynamic block
Add Related Products Tags Add to caching tags, defines for products.

Debug

Option Description
Show Time Stats Show green block with FPC info in frontend.
Enable flush cache button Add button in green block in frontend. "Flush current page cache" - flush cache only for current page. "Flush depending tags cache" - flush cache by tags for current page and depending pages.
Enable Debug Hints Show debug hints.
Enable Debug Log Create log file ( fpc_debug.log ) with FPC actions.
Enable Flush Cache Log Create log file ( fpc_debug_flush_cache.log ) with FPC flush cache actions.
Show debug data and logs only for Comma separated IP addresses.

Crawler Settings

Option Description
Enabled Enable Mirasvit Crawler. Extension will automatically visit all not cached pages defined at Crawler URLs.
Note: If feature disabled, extension will work as before, but without automatically caching not cached pages.
Number of Threads Defines the number of parallel requests during this process.
Note: A higher number of threads will reduce the amount of time required to cache all pages, however it will also consume more system resources. We recommend 1 to 5 parallel threads.
Limit of Crawled URLs per Run Defines maximum number of crawled URLs per one cron (or shell) run
Schedule Specifies how often cron must run crawler. Uses Cron format. For example, 0 */3 * * * means every 3 hours. Most useful examples also can be found here.
Sort Crawler urls by allows to set sort order for crawled Urls by Popularity or by Custom Order at the Crawler Urls list (System -> Full Page Cache -> Crawler URLs).
To see how to set up Custom Order, go to Crawler URLs Page and check Sort by page type and Sort by product attribute settings.
Limit for crawled urls If enabled will crawl only a predetermined number of links. Leave empty or set 0 to don't use.

Crawler for logged user

  • Select customer groups for crawl - additional option, that defines customer groups which will be crawled by Mirasvit Crawler with options, defined in this section.

Contains the same options as [Crawler Settings]() section above, but works for logged-in customers.

Extended crawler setting (for both crawlers)

Option Description
Run crawler as apache user Enable only if crawler don't work with current configuration.
Disable url filter For most part of stores recommended to disable. If enabled will add in Crawler Urls also urls which contains /catalog/product/view/, /catalog/category/view/, index.php, //.
Add crawled URLs directly in database If enabled add urls directly in database. Will not use fpc.log file.
Don't verify peer Determines whether SSL certificates should be validated for requests sent over a HTTPS connection.
Crawler Ignored Pages List of not allowed for crawler pages (regular expression). Recommended: /\?[^p][^=]*/
Generate crawler urls Generate category and product urls for crawler. Urls will be added in System -> Full Page Cache -> Crawler URLs and System -> Full Page Cache -> Crawler URLs for logged in users.
Htaccess authentication If .htaccess authentication enabled add username and password (username:password) in this field.
Full Page Cache