Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8848855
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:30:03+00:00 2026-06-14T12:30:03+00:00

I am working on an AngularJS app with several directives. The directive’s templates are

  • 0

I am working on an AngularJS app with several directives. The directive’s templates are stored in a separate html file. When editing these template, my browser does not detect any changes after a reload and always uses a cached version. Any other changes to the source code are detected and lead to a reload.

I guess the problem is somewhat the $templateCache which seems to be used by AngularJS when loading the template.

What I found in the source code of AngularJS 1.0.2 is the following from line 4317 which is part of the compileTemplateUrl():

$http.get(origAsyncDirective.templateUrl, {cache: $templateCache})

I am wondering if anyone else had this kind of problem and if there is a way to tell AngularJS when to cache and when not.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:30:05+00:00Added an answer on June 14, 2026 at 12:30 pm

    The template cache is stored in your browser, as this is a javascript app. You can actually feed the $cache manually or stop your browser from caching the templates (as it would seem that for production, cache won’t be a problem), using developer tools.

    For force feeding the cache:

    function Main($cache) {
        $cache.data['first.html'] = {value: 'First template'};
        $cache.data['second.html'] = {value: '<b>Second</b> template'};
    
    }
    
    Main.$inject = ['$xhr.cache'];​
    

    See it working in this fiddle.

    To stop your browser from caching the templates (cited from this Google Groups post, about this problem, exactly):

    My team and I have ran into this same issue. Our solution for
    development while using Chrome was to open Developer Tools, and select
    the gear in the bottom right hand corner. Then select Network –
    Disable cache.

    This fixed all our partial/template caching issues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the AngularJS seed project and I've added $locationProvider.html5Mode(true).hashPrefix('!'); to the app.js file.
I'm working with angularjs and I want to be able to load directives as
I am working with AngularJS for my latest project. In the documentation and tutorials
I'm newbie in angularJS world and I probably misunderstand something. My app use controllers,
I'm writing some test for our app, and I've included angularjs-mocks.js so I can
I'm working on an app where we need to dynamically load (don't ask) angular.js
Working on an app using Akka 2 deployed with Play-mini. I pulled logback into
Working on a multi-tenant app where most of my models will have a tenant_id
I'm here for a little question about angularJS... Currently at work we are working
Working in an app where a page_title method was defined in application_helper.rb as such:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.