S
S
Stan_12019-11-06 20:19:31
Vue.js
Stan_1, 2019-11-06 20:19:31

How to cache Nuxt SSR for smartphones and PCs?

Please help, I can't figure it out. I started to make a project on Nuxt / Vue (at the same time I want to learn). Fastened vue-mq, which allows you to create different views for mobile devices and PCs. But when loading the site, first something average is generated, indigestible, and only then, the site is abruptly rebuilt in accordance with the layout logic on a particular screen.
Is there some kind of mechanism that allows you to have cached versions for different devices on the Server-side and give them away? I can't figure out what the best way is here. :(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WinPooh32, 2019-11-13
@WinPooh32

If the page is redrawn by scripts depending on the device, then you will not be able to cache the render, this only works when your page is formed using css styles.
As a solution, use different routes for different views.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question