0

My single page angularjs application seems to work fine in IE9+ until you edit an object and reload the page. If you modify a field (change Name from "You" to "Me") then press save the server gets the update and updates the database. If you then refresh the page the field has its original value (Name is "You"). Refreshing the page does not call the $routeProvider and does not go to the server.

None of this happens on Chrome, Firefox, Safari, or their mobile counterparts.

Andrew Boes
  • 2,013
  • 4
  • 22
  • 29
  • Could be that IE is caching response from the server? If that's the case, try to set No-Cache headers on the server side. – PrimosK Sep 26 '13 at 20:58
  • We had this exact problem with a JSON service in our angular app. Setting the server side cache header is a good idea. If you don't control that part, you can add something to the $resource or $http.. (http config has a cache: false property you can use) – Lucas Holt Sep 26 '13 at 21:39
  • @PrimosK That did it. I'm not sure if this is a good long term solution. The good news is that the browser still caches script files. – Andrew Boes Oct 24 '13 at 21:28

2 Answers2

0

One of the biggest issues with IE is that it doesn't handle console.log unless the console is open and will break just about everything. Not sure if this is your problem, but always good to check.

Ty Danielson
  • 669
  • 1
  • 9
  • 19
0

My server side is an ASP.Net MVC app so I disabled caching.

Set the OutputCache attribute on the whole controller or certain actions

    [OutputCache(Location = OutputCacheLocation.None)]
    public class HomeController : Controller
    {  
        //All actions in here won't be cached.
    }

Used @KCD's answer from this question:

How do I add site-wide no-cache headers to an MVC 3 app

Community
  • 1
  • 1
Andrew Boes
  • 2,013
  • 4
  • 22
  • 29