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
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.
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
| Symptom | Likely Cause | Next Step |
|---|---|---|
| Old script logic runs after editing script content in place (same filename) | Unified bundle not yet regenerated by UltraCart's change-detection | Republish 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 bundle | Confirm via Debugging Tools; consider data-uc-ignore |
| New script works in incognito but not in your regular browser | Client-side browser cache | Hard refresh (Ctrl+Shift+R) or clear your browser cache |
| New script works in incognito but is still stale for other visitors | CDN edge cache still serving the prior bundle | Escalate — see Escalation |
Script tagged data-uc-ignore still appears stale | Script 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:
- View the page source on the live StoreFront page and locate the unified bundle URL — look for a
_mgsuffix. - 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.js → my-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:
- Confirm the new filename actually appears in the rendered page source.
- Check whether that reference is being served from a unified bundle (
_mgsuffix) 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:
- Inspect the page source to confirm the script tag was left untouched (no unification).
- 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
curlor 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-ignorewas tested, and the result - Browser/incognito test results
Related Documentation
- Preventing Script Optimization — how script unification and end-of-page deferral work, and the
data-uc-ignoreattribute - Storefront Privacy & Tracking — configuring analytics, pixels, and custom tracking scripts on a StoreFront