Creating a basic MVC form, I have been experimenting with the Javascript Cache API to store all my css, js, and html files. This way, even if users are in areas with unreliable internet access, they can still access my web form. In addition to IndexedDB and service workers, which help detect connectivity status and save data locally when there is no connection, I am utilizing caching techniques.
While tutorials have made it seem easy to cache physical files like css, html, and js, the routing nature of MVC adds complexity. I have set up the basic views for Index, Create, Edit, and Details. When trying to cache specific URLs like:
var urlsToCache = [
'/App/Details',
'/App/Edit',
'/App/Create',
'/App/Index',
'/App/Content/bootstrap.css',
'/App/Content/site.css',
'/App/Scripts/jquery-1.10.2.js',
'/App/Scripts/jquery.form.js',
'/App/sw.js',
'/App/Scripts/bootstrap.js',
] ...all files get cached except for DETAILS and EDIT. Surprisingly, INDEX and CREATE cache successfully despite not being physical files. The assumption is that DETAILS and EDIT fail to cache due to their reliance on querystring parameters.
My question is, is there a way to cache these two views as well? Alternatively, does anyone know of a NuGet package that could help with this issue?