javascript - Prevent html pages from browsing caching -


the problem having partial files(*.html) getting cached browser. while developing it's not big problem once deploy application, clients see old page(s) until clear cache or hit ctrl f5 have tried specifying meta tags(cache-control,expires) still see pages getting picked cache in developer tool of chrome (maybe missing here?).

i going try , add random number in front of url

<div ng-include src="'views/test.html?i=1000'"></div> 

but came across https://groups.google.com/forum/#!topic/angular/9gorrowzp2m ,where james cook rightly states way fill cache partials on , over.

i read somewhere it's better set meta tags in headers server don't know how that? thinking of somehow doing in http interceptor?maybe somehow add meta tags in request or response of httpinterceptor? https://gist.github.com/gnomeontherun/5678505

any ideas how that? or if it's good/bad idea? or other way prevent partial pages getting cached browser?

to prevent caching in many circumstances not possible turn off client side only. have configure server in right way produces right http-headers.

but of $templatecache can move html partials form single files script tags in index.html file. reduce number of ajax calls app needs make. templates in index.html need make sure index.html not getting cached.

here discussion of it: is there way make angularjs load partials in beginning , not @ when needed?


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -