0

I have an single page application created in MVVM and knockout,typescript technology. I am using knockout templating for creating different views within a Page. The application Page has a view which shows a list of tasks user can start,pause,resume tasks.accordingly status changes using knockout.The database is getting updated but the UI doesnt reflect changes. This application works fine in chrome but in IE the page doesn't get refreshed.In IE when from settings i choose request for new version of stored pages everytime.It works fine in IE also. can any one help me out with a solution for this problem

Dev123
  • 56
  • 1
  • 8
  • after the user changed the status, are you fetching data (json) from the server and try to update the observables with the retrieved data? – chris vietor Jul 11 '14 at 11:35
  • yes i am doing that as well and it works fine in chrome having issues only with IE – Dev123 Jul 11 '14 at 11:39

1 Answers1

2

It seems that your problem with the non-refreshing UI is a json caching problem.

Try to disable jquery ajax caching

$.ajaxSetup({ cache: false });

globally or just temporarily for the request which causes the problem.

IE is caching JSON responses, you wil find your response as a .json file in the temporary internet files folder :)

More information can be read here

Community
  • 1
  • 1
chris vietor
  • 2,050
  • 1
  • 20
  • 29
  • Thanks solution worked for me :).. can you explain the root cause for this – Dev123 Jul 11 '14 at 12:25
  • 1
    Usually a combination of response headers and the actual requested uri are used by the browser to determine whether to cache or not and how long to do so. The request headers usually have to be set on the webserver somehow, while the uri can be made distinct on each request via query string parameters which is what the ajaxSetup({ cache: false }) is actually doing (mentioned in the link provided by infadelic). Here is a link for more details on the IE ajax caching: http://www.greenvilleweb.us/how-to-web-design/problem-with-ie-9-caching-ajax-get-request/ – bingles Jul 14 '14 at 13:27