当前位置:网站首页>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
边栏推荐
猜你喜欢

1141_ SiCp learning notes_ Functions abstracted as black boxes

Le Service MySQL manque dans le service informatique

3、 High quality programming and performance tuning practical youth training camp notes

UWB learning 1

Leetcode-226. Invert Binary Tree

Bi she - college student part-time platform system based on SSM

Composition API premise

About some details of final, I have something to say - learn about final CSDN creation clock out from the memory model

nacos

Stockage et pratique des données en langage C (haut niveau)
随机推荐
English translation is too difficult? I wrote two translation scripts with crawler in a rage
URP - shaders and materials - light shader lit
基于Flask搭建个人网站
Mobx knowledge point collection case (quick start)
Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.9 introduction to network interface (IX) extending the request3 met
Initial experience of teambiion network disk (Alibaba cloud network disk)
URP - shaders and materials - simple lit
Write CPU yourself -- Chapter 9 -- learning notes
1140_ SiCp learning notes_ Use Newton's method to solve the square root
Outsourcing for four years, abandoned
Summary of customer value model (RFM) technology for data analysis
Kuboard can't send email and nail alarm problem is solved
Flutter riverpod is comprehensively and deeply analyzed. Why is it officially recommended?
Deep learning Flower Book + machine learning watermelon book electronic version I found
Music | cat and mouse -- classic not only plot
Detailed explanation of transform origin attribute
Advanced level of C language (high level) pointer
Build personal website based on flask
Flexible layout (II)
微信小程序中使用wx.showToast()进行界面交互