2

What are some solutions in Angular that force the browser to re-download partial views that have been updated? I'm looking into working with a CMS solution where partial views would be updated regularly.

Are people updating the route URL path in the route config when deploying updates to partial views or tacking on versions to the query string to force the browser to re-download?

We have looked into adding cache-control headers to all partial views but this isn't ideal because browsers will be re-downloading all partial views and not just ones that have changed.

For the CMS pages we were thinking of making an http call to the CMS inside the route config to get the version of the given page and tacking that on as a query string. Has any else implemented something similar?

1 Answer 1

2

One way is in the route Configuration, please add version at the end of the tempateUrl

var version = '?v1.0';

templateUrl: 'templates/add_order.html' + version,

The following example shows that http://plnkr.co/edit/jtFqiEPtnoN8aSizDG8k?p=preview

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.