Skip to main content
How-to

Script CDN Caching Troubleshooting

This guide covers common issues and debugging procedures for merchants who see stale script behavior on their StoreFront after publishing a script change.

Table of Contents

  1. Overview
  2. Quick Diagnostics
  3. Common Issues
  4. Debugging Tools
  5. Escalation

Overview

UltraCart StoreFronts automatically consolidate qualifying external <script> tags into unified .js bundle files, push those bundles to the CDN with GZip and minification applied, and move inline scripts to the bottom of the page. This reduces request count and improves page load time. See Preventing Script Optimization for how that unification and deferral works, and how to opt a script out of it with data-uc-ignore.

Because the unified bundle is a generated artifact rather than a direct copy of your source file, changes to a script's contents or filename do not always propagate to the bundle immediately. This guide covers how to diagnose and work around cases where you continue to see an old script version after publishing a change.

note

As of this writing, there is no documented, merchant-facing way to force immediate regeneration or invalidation of an existing unified CDN bundle. The workarounds below reduce the chance of hitting stale content, but do not guarantee immediate propagation. See Escalation.

Quick Diagnostics

SymptomLikely CauseNext Step
Old script logic runs after editing script content in place (same filename)Unified bundle not yet regenerated by UltraCart's change-detectionRepublish the StoreFront page; if still stale, see Common Issues
Old script logic runs after renaming/versioning the script file (e.g. -v2)Unified bundle still references the prior file, or a browser/CDN edge cache is serving the old bundleConfirm via Debugging Tools; consider data-uc-ignore
New script works in incognito but not in your regular browserClient-side browser cacheHard refresh (Ctrl+Shift+R) or clear your browser cache
New script works in incognito but is still stale for other visitorsCDN edge cache still serving the prior bundleEscalate — see Escalation
Script tagged data-uc-ignore still appears staleScript isn't actually excluded from unification (attribute typo or tag structure issue)Verify the rendered page source shows the script untouched, with no _mg suffix present

Common Issues

Edited script content not reflected after publish

Symptoms: You edit the contents of an existing script (same filename/URL) and republish the StoreFront page, but the browser continues to execute the old logic.

Root Cause: UltraCart unifies external scripts into combined bundle files pushed to the CDN. The system relies on internal change detection to know when to regenerate a bundle, which can lag behind a content-only edit.

Diagnosis:

  1. View the page source on the live StoreFront page and locate the unified bundle URL — look for a _mg suffix.
  2. Fetch that bundle URL directly (outside your browser cache) and check whether it contains the old or new script logic.

Solution: Republish the page again to re-trigger propagation. If the bundle is still stale after a republish and a hard refresh, this is a known gap in the available workarounds — proceed to Escalation.

Renamed or versioned script still shows old behavior

Symptoms: You rename the script file (e.g. my-script.jsmy-script-v2.js) expecting a clean cache break, but the storefront still runs the old logic.

Root Cause: The unified bundle is keyed off UltraCart's own optimization process, not the filename alone. A rename does not guarantee the unified bundle rebuilds on the timeline you'd expect.

Diagnosis:

  1. Confirm the new filename actually appears in the rendered page source.
  2. Check whether that reference is being served from a unified bundle (_mg suffix) or as a standalone <script> tag.

Solution: Add data-uc-ignore="true" to the script tag so UltraCart leaves it untouched. The attribute works on external <script src="…"> tags as well as inline scripts, and excludes the script from unification and CDN offload entirely:

<script src="https://example.com/my-script-v2.js" data-uc-ignore="true"></script>

Republish the page after adding the attribute. This script no longer benefits from CDN edge caching or request consolidation.

data-uc-ignore script still appears stale

Symptoms: You've added data-uc-ignore but still see old behavior.

Root Cause: Most commonly a client-side browser cache holding the previous file, not an UltraCart-side issue, since data-uc-ignore scripts are excluded from unification and CDN offload entirely.

Diagnosis:

  1. Inspect the page source to confirm the script tag was left untouched (no unification).
  2. Test in an incognito window to rule out a local browser cache.

Solution: If incognito resolves it, clear your browser cache or hard refresh. If it persists in incognito, escalate — this would indicate the attribute isn't being honored as expected.

Debugging Tools

  • View page source on the live StoreFront page and compare the rendered <script> tags against what's configured in the page editor. Unified bundles typically carry a distinct suffix (e.g. _mg) that isn't present on your original filenames.
  • Fetch the unified bundle URL directly (outside the browser cache — e.g. via curl or a fresh incognito tab) to determine whether the CDN-served file itself is stale, independent of local browser caching.
  • Incognito or private window isolates client-side browser cache from CDN-level staleness — critical for narrowing down which layer is holding the old version.

Escalation

Bundle generation happens on UltraCart's side, so there is nothing further you can inspect yourself once the checks above are exhausted. Contact UltraCart support if staleness persists after you've tried, in order: republishing, a hard refresh/incognito test, and (if applicable) adding data-uc-ignore.

Collect this information before you contact support:

  • Account ID / store ID
  • StoreFront page URL
  • Exact script filename(s) before and after the change
  • Timestamp of the publish action
  • The unified bundle URL observed in the page source (if present)
  • Whether data-uc-ignore was tested, and the result
  • Browser/incognito test results
Was this page helpful?