当前位置:网站首页>vus. Precautions for SSR requesting data in asyndata function
vus. Precautions for SSR requesting data in asyndata function
2022-07-07 07:37:00 【Attacking-Coder】
Abstract
If you need to request data during server rendering, you cannot use mouted Request in life cycle , This is because mouted The request will not be sent until all component instances are hung on the page , Such a request is actually completed on the client side, which is not conducive to SEO. And we're doing it SSR The original intention is to speed up the loading of the first screen , Another is for SEO( Crawled by reptiles ),
So we're going to be here asynData Execute in the declaration cycle
Be careful
- If the page is refreshed asynData The request of is completed on the server
- If the page is jumped in by other pages, then asynData My request is in The client finished
explain : Why is the request completed on the client when entering from other pages ?
This is because the crawler will not click from a page to enter the page , It will only directly enter the designated URL So this will not affect SEO
Secondly SSR It is mainly to solve the problem of slow loading of the first screen , Then it's definitely not your first screen to jump in
边栏推荐
- 电商常规问题part1
- How to reduce inventory with high concurrency on the Internet
- Why is the row of SQL_ The ranking returned by number is 1
- Leetcode-543. Diameter of Binary Tree
- Torefs API and toref API
- Readonly read only
- Interviewer: what development models do you know?
- Bindingexception exception (error reporting) processing
- Composition API premise
- idea添加类注释模板和方法模板
猜你喜欢
Leetcode-206. Reverse Linked List
Lm11 reconstruction of K-line and construction of timing trading strategy
Sqlmap tutorial (IV) practical skills three: bypass the firewall
四、高性能 Go 语言发行版优化与落地实践 青训营笔记
Stockage et pratique des données en langage C (haut niveau)
Make a bat file for cleaning system garbage
面试官:你都了解哪些开发模型?
4、 High performance go language release optimization and landing practice youth training camp notes
A concurrent rule verification implementation
idea添加类注释模板和方法模板
随机推荐
Hidden Markov model (HMM) learning notes
一、Go知识查缺补漏+实战课程笔记 | 青训营笔记
点亮显示屏的几个重要步骤
Role of virtual machine
At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
Outsourcing for four years, abandoned
[semantic segmentation] - multi-scale attention
外包干了四年,废了...
A concurrent rule verification implementation
L'externalisation a duré trois ans.
leetcode:105. 从前序与中序遍历序列构造二叉树
JS decorator @decorator learning notes
[cloud native] how to give full play to memory advantage of memory database
The annual salary of general test is 15W, and the annual salary of test and development is 30w+. What is the difference between the two?
面试官:你都了解哪些开发模型?
Abnova immunohistochemical service solution
2、 Concurrent and test notes youth training camp notes
Interviewer: what development models do you know?
微信小程序中的路由跳转
MobaXterm