User Agents

Web browsers and everyday web tech, explained

How to Clear X Cart Cache: Step-by-Step Guide

· 5 min read · Cookies and Cache

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Clearing the X-Cart cache helps resolve display issues, update changes to your store, and improve performance by removing outdated or corrupted temporary data. This process forces X-Cart to rebuild its cached files, ensuring that recent updates to themes, modules, products, or configurations appear correctly on the storefront. Before proceeding, ensure you have administrator access to your X-Cart store and, if possible, a recent backup of your site. This guide applies to X-Cart 5.x versions, the most widely used edition.

What You'll Need

  • Administrator login credentials for your X-Cart store
  • Access to your X-Cart installation directory (via FTP, SFTP, or file manager in hosting control panel)
  • Optional: a recent backup of your database and files
  • Basic familiarity with your hosting environment (e.g., cPanel, Plesk, or direct server access)

Step-by-Step

  1. Log in to your X-Cart admin dashboard using your administrator credentials. Navigate to the backend by going to yourstore.com/admin.php (replace with your actual domain).
  2. Once logged in, go to the top menu and click on System. From the dropdown, select System tools.
  3. In the System tools section, locate the Clear cache button. This is usually near the top of the page. Click it to initiate the cache-clearing process.
  4. Wait for the confirmation message. X-Cart will display a success message such as "Cache cleared successfully" once the operation is complete. This may take a few seconds depending on server performance.
  5. Verify that the cache has been cleared by visiting your storefront. Check if updated content (e.g., new product images, changed prices, or modified layout) now appears correctly.
  6. If the changes are not visible, proceed to manually clear the cache files via the file system. Connect to your server using FTP, SFTP, or your hosting provider’s file manager.
  7. Navigate to the /var/ directory inside your X-Cart installation root (typically found at public_html/var/ or www/var/).
  8. Inside the /var/ folder, locate and delete the contents of the following subdirectories:
    • cache/ – stores compiled templates and configuration caches
    • compiled/ – holds PHP-compiled template files
    • sessions/ – temporary user session data (safe to clear)
    • tmp/ – general temporary files
    Do not delete the folders themselves—only their contents.
  9. After clearing these directories, return to your admin panel and reload the page. X-Cart will automatically regenerate necessary cache files as users access the site.
  10. Test your store thoroughly. Check the homepage, product pages, admin settings, and checkout process to ensure everything functions correctly and displays updated content.

Common Mistakes

  • Deleting the entire /var/ directory: This can break your store. Only clear the contents of cache subdirectories, not the folders themselves or the parent /var/ folder.
  • Ignoring file permissions: After manually clearing cache files, ensure the /var/ and its subdirectories remain writable by the web server (usually 755 or 775, depending on server setup). Incorrect permissions can prevent X-Cart from regenerating cache.
  • Forgetting to clear browser cache: Sometimes, old content appears because the user’s browser is showing a cached version. Hard refresh (Ctrl+F5 or Cmd+Shift+R) or clear browser cache to confirm the fix.
  • Clearing cache during high traffic: Avoid doing this during peak hours, as regenerating cache can temporarily slow down the site.
  • Not backing up before cache clearance: While rare, cache-related issues can expose deeper configuration problems. Having a backup allows quick recovery if needed.

Tips

  • Use the admin panel method first—it’s safer and sufficient for most updates.
  • After major updates (e.g., module installations or theme changes), clear the cache immediately to ensure changes take effect.
  • Set up a routine maintenance schedule to clear cache weekly if your store sees frequent content updates.
  • If using a reverse proxy or CDN (like Cloudflare), also clear their cache separately, as they may serve stale content even after X-Cart cache is cleared.
  • Monitor server logs if cache rebuild fails repeatedly—this could indicate disk space limits or PHP memory issues.

Troubleshooting

If clearing the cache doesn’t resolve the issue, consider the following steps:

  • Site displays errors after clearing cache: Ensure the /var/ directory and subfolders are writable. Set permissions to 755 via FTP or file manager. If issues persist, restore from backup and check for failed updates.
  • Changes still not visible: Confirm that the update was actually saved (e.g., product price was updated in admin). Also, clear any third-party caching (browser, CDN, server-level opcode cache like OPcache).
  • Admin panel inaccessible after cache clear: This may indicate a deeper server issue. Check file ownership and disk space. Contact your hosting provider if the server returns 500 errors.
  • Cache clears but regenerates incorrectly: This can happen with corrupted templates or modules. Disable recently installed modules and re-clear cache to isolate the cause.
  • Slow performance post-clear: This is normal temporarily. The first few visits after cache clearance will be slower as files rebuild. Performance should normalize within minutes.

Frequently Asked Questions

How often should I clear X-Cart cache?

Clear the cache whenever you make changes to themes, modules, product information, or store settings. For routine maintenance, once a week is sufficient for most stores.

Does clearing cache delete products or orders?

No. The cache only stores temporary performance files. Your products, customer data, and orders remain intact in the database.

Can I automate cache clearing?

Yes, some hosting environments allow cron jobs to clear /var/cache/ and /var/compiled/ periodically, but use caution. It’s better to clear cache manually after updates.

Why does my site look broken after clearing cache?

This may happen if template files are missing or corrupted. Check file integrity and ensure all theme files are uploaded correctly. Reinstall the theme if needed.

Is it safe to clear the sessions folder?

Yes, but users will be logged out. Clearing /var/sessions/ is safe and often helps resolve login or cart issues.

Do I need to clear cache after every update?

Yes. X-Cart does not always auto-clear cache after updates. Manually clearing ensures changes are reflected immediately.