I have two pages like (Online page and Offline page) using SPA in angular and MVC. If a network is lost offline page should work and an Online page should not load, it should display error. (There is no Internet connection). What I did, I have created a Manifest file and added to Layout HTML. whenever I am loading my SPA manifest is added to application cache. Now if a network is gone, when I will click on the Online page nothing is happening due to application cache. What I have to do now I have to remove the application cache from the browser. Please let me know to achieve this scenario.
I tried to remove the application cache using MVC controller, but this one is not working.
filterContext.HttpContext.Response.Cache.SetExpires(DateTime.UtcNow.AddDays(-1));
filterContext.HttpContext.Response.Cache.SetValidUntilExpires(false);
filterContext.HttpContext.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches);
filterContext.HttpContext.Response.Cache.SetCacheability(HttpCacheability.NoCache);
filterContext.HttpContext.Response.Cache.SetNoStore();