-1

I am developing product in language HTML CSS and AngularJS and Api are written in JAVA.Whenever their is update in any functionality I need to clear cache then only changes are reflected, clearing cache is not feasible solution.

Cœur
  • 37,241
  • 25
  • 195
  • 267

2 Answers2

0

As you the problem is with browser cache, so you can implement cache busting. Main idea behind cache busting is

  1. When browser asks for a particular .js/.css/.html file, you need to provide new files with different name.
  2. So that browser will request for new files next time and now caching is gone.
  3. Go through this implementation - Same problem as yours
Community
  • 1
  • 1
psycho
  • 102
  • 8
0

I was faced with similar problem in development. Here're few solutions I came across.

You could use incognito tab in development environment. This would automatically clear the cache with every new tab. One drawback is that you'll have to login or navigate to needed page.

Another solution used was clearing cache by JavaScript. Here versioning is used to identify whether new change occurred. If the version number is changed script would be run to clear browser cache. This is a separate task and should be changed differently for different browsers. However this would slow down website performance.
This is useful in production envirnoment rather than in development. Simply because we cant ask users to clear cache or use incognito everytime.

udarabibile
  • 503
  • 1
  • 6
  • 16