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 Git config.
tip
Check out the related BigCommerce Cache reference to get started with customizing your BigCommerce Cache module.
note
Submit a support request by clicking the Support link in the left sidebar if you need help managing this module.
Clear cache
Follow the steps below to clear the BigCommerce Cache module for an environment in your project:
Console
- Go to the clear cache of the environment you want to clear the BigCommerce Cache module for.
- Clear individual cached objects either through a particular URL or a custom Varnish Cache ban expression, or all cached objects.
API
Go to the API documentation.
In the API list, click on Proxy.
In the Proxy list, click on the following API endpoint:
POST /account/{accountId}/application/{applicationId}/environment/{environmentName}/proxy/{proxyName}/state
Build your API call by filling out the required parameters.
tip
The
accountId
,applicationId
, andenvironmentName
parameters can be obtained from the browser address bar when logged in to your CloudFlow organization. TheproxyName
is the directory name of the module that is in the associated Git config (typicallybigcommercecache
).
Strip query strings
Follow the steps below to strip query strings to improve the cache hit rate for an environment in your project:
Go to the Git config of the environment you want to strip query strings for.
In the environment's
bigcommercecache/custom.vcl
file, add the following to thevcl_recv
subroutine::bigcommercecache/custom.vclsub 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:
Go to the Git config of the environment you want to delete the BigCommerce Cache module from.
In the top of the page, copy the URL next to Clone with HTTPS.
Open a terminal and change the current working directory to the location where you want the cloned environment repository.
Clone the environment repository to your local computer. Type
git clone
followed by the copied URL and then press Enter:git clone <copied_url>
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.
In the environment's
section.config.json
file, delete the module object from theproxychain
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"
},
...
],
...Stage, commit, and push the changes to the environment's remote repository:
git add .
git commit -m "Delete the BigCommerce Cache module"
git push