javascript - Using angular's templateCache in case of large apps -
i working on optimizing pretty large angularjs application 100+ templates. use grunt automation. trying achieve here need prefix urls in production code cdnurl plan host static assets on cdn.
i tried using this grunt plugin , replace references in code except templateurls in <ng-include>
tags , in ui routers state configuration.
hence thought of solving issue precompiling angular js templates single js file using $templatecache
service using this plugin. after checking out size of precompiled js file found out whopping 1.13 mb html minified.
comparing overall app takes 1.5 ~ 1.7 mb entire app during first load. don't find legible include precompiled template forces lot of weight downloaded on user's device. there views partially restricted users , speaking feel unfair load data sections of app many users won't anyway visiting.
so guys recommend in such cases ? still preferable use $templatecache in production? if not regarding prefixing angular templates cdn url using grunt helpful.
Comments
Post a Comment