2.5.13
https://runkit.com/martinlg/issue-vue-renderer-cache
Run the Runkit code. If you prefer a git repository I can provide you one.
The value passed to the set
function should be a string.
The value passed to the set
function is an object, with 2 properties:
string
containing the rendered componentSet
containing nothing or function, depending on context (sub-components I think)This issue breaks any external cache possibility (Redis in my case).
The only possible cache is in the process memory, like the LRUCache, but it seems impossible to scale processes and share a common cache.
Moreover, the documentation explain clearly that the cached value should be a string, and even provides a small Redis example implementation, that could just not work.
I think that the documentation describe the expected behavior, so I don't want to "fix" the documentation, I think we should fix the behavior.
I will try to help but I may need some explanations on some parts of the RenderContext, can I ask my questions on this thread ?
I don't think SSR cache behavior is expected, either.
https://github.com/vuejs/vue/blob/dev/packages/vue-server-renderer/types/index.d.ts#L46-L48
However, component cache also needs to cache component's lifecycle in rendering. So the type definition and documentation are both outdated.
Actually, I don't see why we should cache component's lifecycle in rendering.
The component should be rendered, its template should be cached as a string (the html part of the currently stored object). Then when the component get fetched from the cache, it's template is static, and should not depend of the store. So I don't see why we should register all its child components.
Of course the browser takes back the hand, and make them dynamic like every components.
Did I miss something ?
I just tried to remove the component registration and I see now that it breaks the inline styles on the cached version.
Still looking for a solution to store the cache on an external data store.
@Atinux This is the issue I told you about. If you have any suggestions that could help me on SSR, I would love to ear it.
I don't believe caching doesn't work as it should be o_O Maybe some PR will help fix this? And it still opened... from February? Does no one use the cache or what?
Any updates on this? Having same issue with redis client.
the same issue . I want to use redis client , but the components is a Set .
Wow, this is just extremely disappointing. Especially since the SSR docs explicitly show a redis client example. https://ssr.vuejs.org/api/#cache
Has there been any progress on this or has everyone given up on having a shared cache?
Most helpful comment
Wow, this is just extremely disappointing. Especially since the SSR docs explicitly show a redis client example. https://ssr.vuejs.org/api/#cache