Angular app has to clear cache after new deploymentAngular page reload issue due to browser cacheWhy angular delete its output directory folder?How to force the browser to reload cached CSS/JS files?Prevent RequireJS from Caching Required ScriptsNew deployment, have browser cache cleared the first time the page is loadedEnterprise app deployment doesn't work on iOS 7.1Clear Angular JS templateCache once (for each deployment)How to clear cache of service worker?Laravel deployment with capistrano cache filesImplement caching in a way that on new build upload no cache clearing requiredAngular Clear Cache On updateUpdated code not reflecting after deployment Angular 4
Why does this image of Jupiter look so strange?
Does "as soon as" imply simultaneity?
Norwegian refuses EU delay (4.7 hours) compensation because it turned out there was nothing wrong with the aircraft
Meaning of 小せェサル in the following sentence
How to manage expenditure when billing cycles and paycheck cycles are not aligned?
Functional analysis of the Pink Panther
1, 2, 4, 8, 16, ... 33?
What is the size of a set of sets of the empty set , , ?
How do pilots align the HUD with their eyeballs?
Strange Sticky Substance on Digital Camera
Do we know the situation in Britain before Sealion (summer 1940)?
Two trains move towards each other, a bird moves between them. How many trips can the bird make?
What's the next step in this Unequal (Futoshiki) puzzle?
What's the lowest risk highest reward I can invest in for 5 years?
Cut a cake into 3 equal portions with only a knife
Can an integer optimization problem be convex?
A high quality contribution but an annoying error is present in my published article
Could Apollo astronauts see city lights from the moon?
Is there a way to hide HTML source code yet keeping it effective?
What is the need of methods like GET and POST in the HTTP protocol?
A food item only made possible by time-freezing storage?
Is "ln" (natural log) and "log" the same thing if used in this answer?
How do I deal with too many NPCs in my campaign?
My manager quit. Should I agree to defer wage increase to accommodate budget concerns?
Angular app has to clear cache after new deployment
Angular page reload issue due to browser cacheWhy angular delete its output directory folder?How to force the browser to reload cached CSS/JS files?Prevent RequireJS from Caching Required ScriptsNew deployment, have browser cache cleared the first time the page is loadedEnterprise app deployment doesn't work on iOS 7.1Clear Angular JS templateCache once (for each deployment)How to clear cache of service worker?Laravel deployment with capistrano cache filesImplement caching in a way that on new build upload no cache clearing requiredAngular Clear Cache On updateUpdated code not reflecting after deployment Angular 4
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
We have an Angular 6 application. It’s served on Nginx. And SSL is on.
When we deploy new codes, most of new features work fine but not for some changes. For example, if the front-end developers update the service connection and deploy it, users have to open incognito window or clear cache to see the new feature.
What type of changes are not updated automatically? Why are they different from others?
What’s the common solution to avoid the issue?
javascript angular nginx deployment
add a comment
|
We have an Angular 6 application. It’s served on Nginx. And SSL is on.
When we deploy new codes, most of new features work fine but not for some changes. For example, if the front-end developers update the service connection and deploy it, users have to open incognito window or clear cache to see the new feature.
What type of changes are not updated automatically? Why are they different from others?
What’s the common solution to avoid the issue?
javascript angular nginx deployment
add a comment
|
We have an Angular 6 application. It’s served on Nginx. And SSL is on.
When we deploy new codes, most of new features work fine but not for some changes. For example, if the front-end developers update the service connection and deploy it, users have to open incognito window or clear cache to see the new feature.
What type of changes are not updated automatically? Why are they different from others?
What’s the common solution to avoid the issue?
javascript angular nginx deployment
We have an Angular 6 application. It’s served on Nginx. And SSL is on.
When we deploy new codes, most of new features work fine but not for some changes. For example, if the front-end developers update the service connection and deploy it, users have to open incognito window or clear cache to see the new feature.
What type of changes are not updated automatically? Why are they different from others?
What’s the common solution to avoid the issue?
javascript angular nginx deployment
javascript angular nginx deployment
asked Mar 28 at 16:37
zhangjinzhouzhangjinzhou
7235 silver badges30 bronze badges
7235 silver badges30 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
The problem is When a static file gets cached it can be stored for very long periods of time before it ends up expiring. This can be an annoyance in the event that you make an update to a site however, since the cached version of the file is stored in your visitors’ browsers, they may be unable to see the changes made.
Cache-busting solves the browser caching issue by using a unique file version identifier to tell the browser that a new version of the file is available. Therefore the browser doesn’t retrieve the old file from cache but rather makes a request to the origin server for the new file.
Angular cli resolves this by providing an --output-hashing
flag for the build command.
Check the official doc : https://angular.io/cli/build
Example
ng build --aot --output-hashing=all
Below are the options you can pass in --output-hashing
- none: no hashing performed
- media: only add hashes to files processed via [url|file]-loaders
- bundles: only add hashes to the output bundles
- all: add hashes to both media and bundles
It works. Thank you for the solution. Could you please explain what situations could cause the problem? As I mentioned, the problem doesn't happen to all updates.
– zhangjinzhou
Mar 28 at 18:18
@zhangjinzhou updated the answer with explanation , please mark it as answer if it helps you
– Joel Joseph
Mar 29 at 6:28
Thanks for the explanation!
– zhangjinzhou
Mar 29 at 17:16
I have the same issue. After each build/deployment I have to clear cache. Could you please tell me where should I add the above command?In angular side or devOps side?
– Anand Raj
Sep 4 at 7:07
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55402751%2fangular-app-has-to-clear-cache-after-new-deployment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The problem is When a static file gets cached it can be stored for very long periods of time before it ends up expiring. This can be an annoyance in the event that you make an update to a site however, since the cached version of the file is stored in your visitors’ browsers, they may be unable to see the changes made.
Cache-busting solves the browser caching issue by using a unique file version identifier to tell the browser that a new version of the file is available. Therefore the browser doesn’t retrieve the old file from cache but rather makes a request to the origin server for the new file.
Angular cli resolves this by providing an --output-hashing
flag for the build command.
Check the official doc : https://angular.io/cli/build
Example
ng build --aot --output-hashing=all
Below are the options you can pass in --output-hashing
- none: no hashing performed
- media: only add hashes to files processed via [url|file]-loaders
- bundles: only add hashes to the output bundles
- all: add hashes to both media and bundles
It works. Thank you for the solution. Could you please explain what situations could cause the problem? As I mentioned, the problem doesn't happen to all updates.
– zhangjinzhou
Mar 28 at 18:18
@zhangjinzhou updated the answer with explanation , please mark it as answer if it helps you
– Joel Joseph
Mar 29 at 6:28
Thanks for the explanation!
– zhangjinzhou
Mar 29 at 17:16
I have the same issue. After each build/deployment I have to clear cache. Could you please tell me where should I add the above command?In angular side or devOps side?
– Anand Raj
Sep 4 at 7:07
add a comment
|
The problem is When a static file gets cached it can be stored for very long periods of time before it ends up expiring. This can be an annoyance in the event that you make an update to a site however, since the cached version of the file is stored in your visitors’ browsers, they may be unable to see the changes made.
Cache-busting solves the browser caching issue by using a unique file version identifier to tell the browser that a new version of the file is available. Therefore the browser doesn’t retrieve the old file from cache but rather makes a request to the origin server for the new file.
Angular cli resolves this by providing an --output-hashing
flag for the build command.
Check the official doc : https://angular.io/cli/build
Example
ng build --aot --output-hashing=all
Below are the options you can pass in --output-hashing
- none: no hashing performed
- media: only add hashes to files processed via [url|file]-loaders
- bundles: only add hashes to the output bundles
- all: add hashes to both media and bundles
It works. Thank you for the solution. Could you please explain what situations could cause the problem? As I mentioned, the problem doesn't happen to all updates.
– zhangjinzhou
Mar 28 at 18:18
@zhangjinzhou updated the answer with explanation , please mark it as answer if it helps you
– Joel Joseph
Mar 29 at 6:28
Thanks for the explanation!
– zhangjinzhou
Mar 29 at 17:16
I have the same issue. After each build/deployment I have to clear cache. Could you please tell me where should I add the above command?In angular side or devOps side?
– Anand Raj
Sep 4 at 7:07
add a comment
|
The problem is When a static file gets cached it can be stored for very long periods of time before it ends up expiring. This can be an annoyance in the event that you make an update to a site however, since the cached version of the file is stored in your visitors’ browsers, they may be unable to see the changes made.
Cache-busting solves the browser caching issue by using a unique file version identifier to tell the browser that a new version of the file is available. Therefore the browser doesn’t retrieve the old file from cache but rather makes a request to the origin server for the new file.
Angular cli resolves this by providing an --output-hashing
flag for the build command.
Check the official doc : https://angular.io/cli/build
Example
ng build --aot --output-hashing=all
Below are the options you can pass in --output-hashing
- none: no hashing performed
- media: only add hashes to files processed via [url|file]-loaders
- bundles: only add hashes to the output bundles
- all: add hashes to both media and bundles
The problem is When a static file gets cached it can be stored for very long periods of time before it ends up expiring. This can be an annoyance in the event that you make an update to a site however, since the cached version of the file is stored in your visitors’ browsers, they may be unable to see the changes made.
Cache-busting solves the browser caching issue by using a unique file version identifier to tell the browser that a new version of the file is available. Therefore the browser doesn’t retrieve the old file from cache but rather makes a request to the origin server for the new file.
Angular cli resolves this by providing an --output-hashing
flag for the build command.
Check the official doc : https://angular.io/cli/build
Example
ng build --aot --output-hashing=all
Below are the options you can pass in --output-hashing
- none: no hashing performed
- media: only add hashes to files processed via [url|file]-loaders
- bundles: only add hashes to the output bundles
- all: add hashes to both media and bundles
edited Mar 29 at 6:35
answered Mar 28 at 16:56
Joel JosephJoel Joseph
1,6361 gold badge14 silver badges23 bronze badges
1,6361 gold badge14 silver badges23 bronze badges
It works. Thank you for the solution. Could you please explain what situations could cause the problem? As I mentioned, the problem doesn't happen to all updates.
– zhangjinzhou
Mar 28 at 18:18
@zhangjinzhou updated the answer with explanation , please mark it as answer if it helps you
– Joel Joseph
Mar 29 at 6:28
Thanks for the explanation!
– zhangjinzhou
Mar 29 at 17:16
I have the same issue. After each build/deployment I have to clear cache. Could you please tell me where should I add the above command?In angular side or devOps side?
– Anand Raj
Sep 4 at 7:07
add a comment
|
It works. Thank you for the solution. Could you please explain what situations could cause the problem? As I mentioned, the problem doesn't happen to all updates.
– zhangjinzhou
Mar 28 at 18:18
@zhangjinzhou updated the answer with explanation , please mark it as answer if it helps you
– Joel Joseph
Mar 29 at 6:28
Thanks for the explanation!
– zhangjinzhou
Mar 29 at 17:16
I have the same issue. After each build/deployment I have to clear cache. Could you please tell me where should I add the above command?In angular side or devOps side?
– Anand Raj
Sep 4 at 7:07
It works. Thank you for the solution. Could you please explain what situations could cause the problem? As I mentioned, the problem doesn't happen to all updates.
– zhangjinzhou
Mar 28 at 18:18
It works. Thank you for the solution. Could you please explain what situations could cause the problem? As I mentioned, the problem doesn't happen to all updates.
– zhangjinzhou
Mar 28 at 18:18
@zhangjinzhou updated the answer with explanation , please mark it as answer if it helps you
– Joel Joseph
Mar 29 at 6:28
@zhangjinzhou updated the answer with explanation , please mark it as answer if it helps you
– Joel Joseph
Mar 29 at 6:28
Thanks for the explanation!
– zhangjinzhou
Mar 29 at 17:16
Thanks for the explanation!
– zhangjinzhou
Mar 29 at 17:16
I have the same issue. After each build/deployment I have to clear cache. Could you please tell me where should I add the above command?In angular side or devOps side?
– Anand Raj
Sep 4 at 7:07
I have the same issue. After each build/deployment I have to clear cache. Could you please tell me where should I add the above command?In angular side or devOps side?
– Anand Raj
Sep 4 at 7:07
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55402751%2fangular-app-has-to-clear-cache-after-new-deployment%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown