Skip to Content
0
Former Member
Apr 03, 2014 at 01:09 PM

Lazy loading of views results in view loaded from cache

28 Views

Hi guys,

I'm looking to see if anyone has come across a similar issue where dynamically loaded views or lazily loaded views, are retrieved from the cache?

The scenario:

Page is loaded, a button on the screen is only visible and on click of this button it will put a view onto the page (maybe a dialog box for example).

From the network tab of google chrome, i can see that the view and controller is retrieved from the browsers cache.

There are 2 issues I have with this:

1. During development, this becomes tiresome to clear the browsers cache to get the latest from the server

2. Once live, I do want the view to come from the cache to reduce load time

One alternative is to load the view at initial load time and display it on click, however this is predicting that the user will click the button and not very good practice in terms of reducing page load.

On top of this, once development is finished the application is live and change requests come along, you want the pages to be updated so that the user can experience the new features.

Has anyone got any experience with how to control the caching from a view loading perspective?

There are parameters in the web.xml file however there isn't much information in there about what exactly is being controlled and what the options are.

If anyone can shed some light, that would be great.

Thanks

Mark