How do I clear my store cache?

Clearing your store’s cache is an important part of general website maintenance. A cluttered cache can slow down your site’s performance and cause pages to load incorrectly. Fortunately, clearing your cache is a relatively quick and straightforward process. In this comprehensive guide, we will walk through everything you need to know about clearing your store’s cache.

What is Cache?

Cache refers to temporary data stored on your site’s server or on the user’s browser. When someone visits your website, cache files are created to store certain elements of pages, like images, coding, and design elements. This allows those components to load faster on repeat visits, since they don’t need to be re-downloaded every time.

Cache improves performance by shortening load times. However, over time cache builds up and can get overloaded with unnecessary files that just take up space. Clearing out old cache helps free up space on your server and keeps things running efficiently.

Why You Should Clear Cache

Here are some of the main reasons to clear your store’s cache regularly:

  • Improve site speed – Cache can accumulate outdated and redundant files over time, which can slow down your pages. Clearing it removes bloat so pages can load faster.
  • Fix display issues – An overloaded cache can cause problems with how your site displays. Clearing it can fix missing images, coding errors, or other display issues.
  • Refresh design changes – After making updates to your site’s design or layout, you need to clear cache for them to take effect.
  • Resolve security issues – After updating security protocols or fixing vulnerabilities, clearing cache ensures the fixes apply across your site.

As a general rule of thumb, aim to clear your store’s cache at least once a week. Doing so will maintain optimal performance and prevent stale cache data from causing problems.

How to Clear Server Cache

The steps to clear your server cache will vary depending on which ecommerce platform your store runs on. Here are the basic instructions for some popular platforms:

Shopify

Shopify stores have a quick “Clear cache” button to purge the server cache:

  1. Log in to your Shopify admin.
  2. Go to Online Store > Themes.
  3. Find the “Actions” dropdown menu.
  4. Click “Clear cache.”

This will immediately empty your store’s cache so new visits will load fresh files. Note that it can take up to 24 hours for cache to empty on Shopify’s CDN network.

WooCommerce

For WooCommerce sites, you’ll need to install a cache plugin like WP Fastest Cache or W3 Total Cache. Then you can clear cache right from your WordPress dashboard. Steps may vary by plugin, but generally you would:

  1. Go to Plugins > [Cache Plugin Name].
  2. Look for a “Clear Cache” or “Purge Cache” button.
  3. Click to instantly clear all cache.

Alternatively, you can clear WooCommerce cache by going to Tools > Cart/Store Cache and deleting the files shown.

BigCommerce

BigCommerce stores have a one-click option to flush cache via the control panel. Just follow these steps:

  1. Log in to your BigCommerce admin.
  2. Go to Advanced Settings > Cache.
  3. Click the “Clear Cache” button to purge all cache files.

It may take 15-30 minutes for cache changes to fully propagate after you empty it. You can speed up the process by shift-refreshing to force load new files.

Magento

For Magento stores, you can leverage built-in commands to flush cache from the command line. Here are the steps:

  1. SSH into your server.
  2. Navigate to your Magento root directory.
  3. Run php bin/magento cache:flush to clear all cache types.
  4. You can also target specific caches (config, layout, block, etc) for more granular clearing.

This will purge all cached files so new pages serve fresh content. Remember to recompile if you’ve made design changes.

Browser Cache vs. Server Cache

It’s important to understand the difference between browser cache and server cache:

  • Browser cache – Data that is cached locally on the user’s web browser, like images, page code, and files that make up your website.
  • Server cache – Cached dynamic data that is stored on your web server, like database queries, processed CSS/JS, or full page cache.

Clearing server cache removes stale files from your hosting service. Clearing browser cache removes locally stored site files from your customer’s machines. It’s a good idea to regularly clear both for optimal performance.

When to Clear Browser Cache

In addition to clearing your server cache, you may also want to purge your site’s browser cache in certain situations, like:

  • After major site updates – Clearing browser cache will force load new files
  • New CSS/JS files added – Refresh browser cache so visitors get the updated assets
  • Analytics tracking changes – Ensures visitor data is recorded under new settings
  • To resolve display issues – Fixes some front-end problems caused by stale browser cache

You have a couple options to purge browser cache:

Instruct Visitors to Clear Cache

You can add a notice on your site asking visitors to manually clear their browser cache. Most browsers have a setting to clear cached files under Options, Preferences, Settings or History. This ensures they download the latest files on their next visit.

Force Cache Refresh

Another option is to implement versioning or cache busting for CSS/JS files. This forces the browser to download new code instead of using a cached version. To do this, attach a query string with the time stamp or version number, like style.css?v=1.2. The browser sees it as a new file so it reloads it instead of using a cached copy.

Use Cache Plugin

For WordPress sites, you can install a cache clearing plugin like WP Fastest Cache or WP Super Cache. These let you purge browser cache on demand when you update site content. The plugin will communicate with CDNs and browsers to force reload of all cached files.

CDN Cache

If your site uses a content delivery network (CDN), there is likely cached data there as well. CDNs create edge servers around the globe to cache elements of your site closer to visitors. This dramatically speeds up load times.

The process to clear CDN cache varies by provider. Most include an option to purge cache globally or on specific URL paths. This removes stale CDN cache so new files are served upon the next user request. Check your CDN dashboard for the purge cache controls.

Why Cache Gets Cleared Automatically

In some cases, your store cache will clear automatically without any action needed from you. This typically happens due to actions that modify the underlying content or code.

Some examples of actions that can trigger an automatic cache clear include:

  • Publishing a new blog post
  • Updating a product description
  • Changing design via page builder
  • New code deployment/version release
  • Altering theme files
  • Modifying DNS, domain, or SSL certificates

When these types of changes occur, cached files related to the updated content get automatically invalidated and cleared. The platform recognizes the need to serve fresh, updated cache upon the next request. You still may want to manually clear cache as well after significant updates.

Cache Clearing Services

If manually clearing your cache seems daunting, you can use a cache clearing service to automatically handle it instead. Services like Cloudflare and CacheBreeze can:

  • Instantly purge server cache on a schedule or on demand
  • Clear CDN edge cache globally or by URL
  • Invalidate browser cache to force fresh content
  • Integrate cache purging with your CDN and platform
  • Provide status reports each time cache is cleared

These automated tools help take cache management off your plate so your site always serves fresh content. They provide instant cache purging any time site changes occur.

Cache Clearing Service Key Features
Cloudflare Global CDN cache clearing, browser cache invalidation, URL-based purging, WordPress integration
CacheBreeze Automatic cache clearing on content changes, image optimization, granular URL cache purging, reports/logging
KeyCDN Full CDN cache control, access management, real-time analytics, API-driven automation

Should You Let Cache Clear Automatically?

So when should you just let cache clear automatically versus manually purge it? Here are some guidelines:

  • Small updates – No need to manually clear cache for minor text changes or tweaks. Automatic clears will handle caching the updated content.
  • Major changes – Manually purge cache after site migrations, new themes, structure changes, new caching setups, etc. to remove stale files.
  • New functionality – Clear cache when new site features are launched so all users see them instantly.
  • Ongoing maintenance – Occasional manual clearing as a general best practice, even if auto clears also occur.

Get to know your platform and plugins to understand what actions trigger auto clears. For most changes, allowing automatic cache invalidation is sufficient. But larger updates warrant proactively purging cache yourself to guarantee visitors get the refreshed content and code.

Cache Clearing Best Practices

Here are some top tips for effectively clearing your ecommerce site’s cache:

  • Clear server cache weekly as a general maintenance task.
  • Purge CDN cache whenever new media assets are added.
  • Instruct visitors to clear browser cache after major site updates.
  • Use versioning techniques for CSS/JS to force new file loads.
  • Review platform documentation so you understand what triggers auto clears.
  • Manually purge cache after big changes like new themes or plugins.
  • Monitor logs to see when cache gets cleared and why.
  • Consider a automated cache management service to save time and effort.

Other Cache Management Tips

In addition to clearing cache, here are some other tips for optimal cache management:

  • Enable caching for database objects that don’t change often.
  • Set reasonable expiry times for cached objects.
  • Limit cache size to prevent overloading server resources.
  • Cache page fragments rather than full pages when possible.
  • Use a CDN to distribute cache globally and improve performance.
  • Load test your site to identify cache-related bottlenecks.

Caching done right improves site speed and stability. With a sound cache strategy, you can delight customers with fast, dynamic sites that display flawlessly.

Conclusion

Clearing your ecommerce site’s cache is a quick yet critical optimization task. Stale cached files lead to slow page loads, display issues, and frustrated customers. Getting in the habit of regularly flushing your cache keeps things running smoothly.

Understand the platform tools at your disposal for clearing server and browser cache. For complex sites, leverage cache management services to automate the busywork. Cache freshness is vital for optimal performance. So be vigilant about clearing out old cache to keep each visitor’s experience fast and flawless.

Leave a Comment