Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Allow for cache disabling as a configuration option or parameter to knockout components #2583

Open
strommj opened this issue Jan 4, 2022 · 0 comments

Comments

@strommj
Copy link

strommj commented Jan 4, 2022

I maintain an unconventional application, where our code is rendered many times within an iframe with different data each render. Because of this, using components within this space is also non-conventional, causing old data to be cached with the initial registering of the component on the first render.

clearing the component cache didn't work (is this a bug?), and I had to un-register the component before re-registering it (each time our app is rendered with new data).

My request, since the standard of unregistering a component before registering seems like a bad habit, is to have an option to disable caching for any such component registration. This could be an extra parameter (ko.components.register('foo', true)) or it could be an app level config. Either way, I think there are enough people concerned about the forceful caching of view model data as noted here.

That, or perhaps the nature of this request falls under the notion of allowing dynamic data within the component declaration. By nature, disabling the cache solves this problem as long as the app has some other mechanism to refresh on data changes. However, it seems the component design was oriented towards data that doesn't change, but maybe you have a better idea in mind to solve this.

Regards,
Matt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant