Shell commands

Full Page Cache features two special CLI commands, that should be run via command line:

Both of these scripts are located at <magento_root>/shell/ subdirectory.

Make sure, that you run these commands under apache user.

CLI Site Crawler

Usage: php fpc.php [options]

Option Description
--crawl Run crawler for all allowed stores
--crawl_logged Run crawler for all allowed stores (logged in users)
--status Show crawler status
--status_logged Show crawler for logged in users status
--update_log Update log data (import urls to crawler, update chart data). Read more
--update_log_logged Update log data (import urls to crawler for logged in users)
--clear_by_limits Clear all cache if limits were reached. Read more

Some of these options perform special tasks:

  • php fpc.php --update_log

    This command import Urls to crawler - after each visit page by customer, all visited Urls will be placed to /var/fpc.log. All these Urls will be imported to table: [db_table_prefix]m_fpc_crawler_url, where [db_table_prefix] - your database table prefix. After import, these Urls will be shown at Crawler URLs table: System > Full Page Cache > Crawler`s URLs. This command also updates data сhart.

  • php fpc.php --clear_by_limits

    This command clear all cache if limits were reached. To set cache limits, go to System > Configuration > Full Page Cache and set values for Max. Cache Size (Mb) and Max. Number of Cache Files.

    If you use Redis or Memcache this option will not work, because Redis and Memcache clear cache automatically.

CLI FPC URL Generator

Usage: php -f fpc_generate.php [options]

Option Description
--generate Generate crawler urls without adding in cache (use data from admin panel)
--generate_and_crawl_both Generate and add to the cache (for generation use data from admin panel)
--crawl_both Crawl all generated urls from crawler table (can take a lot of time)
--crawl_logged_in Crawl logged in generated urls from crawler table (can take a lot of time)
--crawl_not_logged_in Crawl not logged in generated urls from crawler table (can take a lof of time)
--store_id Perform action only for store with specified ID. Used as additional argument for --crawl_both, --crawl_logged_in, --crawl_not_logged_in options.

Crawl through all not logged in generated URL's from crawler table only in store with ID = 2:
php fpc_generate.php --crawl_not_logged_in --store_id 2

Full Page Cache