Skip to main content
Classic

BigCommerce Cache

Learn how to use the BigCommerce Cache module.

Deploy

Deploy the BigCommerce Cache module by deploying the BigCommerce Optimizer module.

Manage

Manage the BigCommerce Cache module through the advanced config.

tip

Check out the related BigCommerce Cache reference to get started with customizing your BigCommerce Cache module.

note

Submit a support request if you need help managing this module.

Clear cache

Follow the steps below to clear the BigCommerce Cache module for an environment in your application:

Console

  1. Go to the clear cache of the environment you want to clear the BigCommerce Cache module for.
  2. Clear individual cached objects either through a particular URL or a custom Varnish ban expression, or all cached objects.

API

  1. Go to the API documentation.

  2. In the API list, click on Proxy.

  3. In the Proxy list, click on the following API endpoint:

    POST /account/{accountId}/application/{applicationId}/environment/{environmentName}/proxy/{proxyName}/state
  4. Build your API call by filling out the required parameters.

    tip

    The accountId, applicationId, and environmentName parameters can be obtained from the browser address bar when logged in to your Section account. The proxyName is the directory name of the module that is in the associated advanced config (typically bigcommercecache).

Strip query strings

Follow the steps below to strip query strings to improve the cache hit rate for an environment in your application:

  1. Go to the advanced config of the environment you want to strip query strings for.

  2. In the environment's bigcommercecache/custom.vcl file, add the following to the vcl_recv subroutine::

    bigcommercecache/custom.vcl
    sub vcl_recv {
    if (req.url ~ "[?&](utm_source|utm_medium|utm_campaign|utm_term|utm_content|ep4p_ref|mz.eprzr_crew|eprzr_2seater|gclid|cx|ie|cof|siteurl|mc_cid|mc_eid|hash|changestate|pid|\_)=") {
    set req.url = regsuball(req.url, "(?:(\?)?|&)(?:utm_source|utm_medium|utm_campaign|utm_term|utm_content|ep4p_ref|mz.eprzr_crew|eprzr_2seater||gclid|cx|ie|cof|siteurl|mc_cid|mc_eid|hash|changestate|pid|\_)=[^&]+", "\1");
    set req.url = regsuball(req.url, "(?:(\?)&|\?$)", "\1");
    }
    }
    tip

    The regular expressions can be updated to match any query string that you do not want cached separately.

Delete

Follow the steps below to delete the BigCommerce Cache module from your environment:

  1. Go to the advanced config of the environment you want to delete the BigCommerce Cache module from.

  2. In the top of the page, copy the URL next to Clone with HTTPS.

  3. Open a terminal and change the current working directory to the location where you want the cloned environment repository.

  4. Clone the environment repository to your local computer. Type git clone followed by the copied URL and then press Enter:

    git clone <copied_url>
  5. In the root directory of the environment repository, delete the BigCommerce Cache module directory (typically named bigcommercecache).

    note

    Skip this step to disable the module instead of deleting it.

  6. In the environment's section.config.json file, delete the module object from the proxychain array, which will look like the following:

    section.config.json
    ...
    "proxychain": [
    ...
    {
    "name": "<module_directory_name>",
    "image": "<module_image>"
    },
    ...
    ],
    ...
    section.config.json
    ...
    "proxychain": [
    ...
    {
    "name": "bigcommercecache",
    "image": "bigcommercecache:1.1.0"
    },
    ...
    ],
    ...
  7. Stage, commit, and push the changes to the environment's remote repository:

    git add .
    git commit -m "Delete the BigCommerce Cache module"
    git push