前端随录(SPA与MPA和PWA)

SPA架构模式深度解析:从路由、状态管理到鉴权与部署实践 从Web应用交互体验的演进说起,单页应用(SPA)作为现代前端的主流架构,通过前端路由、状态管理与接口鉴权等机制,实现了无刷新页面切换和前后端分离。它源于对传统多页应用频繁整页刷新痛点的改造,其核心原理是在首次加载时获取应用资源,此后由JavaScript动态渲染页面。这种模式在提升用户体验的同时,也带来了首屏性能、Token刷新、路由404等工程化挑战。结合工程实践,系统梳理SPA的核心机制、JWT登录态管理、第三方登录集成、性能优化及Nginx部署要点,帮助开发者在架构选型与落地时做出更明智的决策。 阅读详情

SPA与MPA和PWA的区别

SPA(single page web application): 单页web应用,就是只有一张Web页面的应用,是加载单个HTML 页面并在用户与应用程序交互时动态更新该页面的Web应用程序。

页面跳转: js渲染
优点: 页面切换快
缺点: 首屏时间稍慢,SEO差

MPA(Multi-page Application): 多页web应用,每一次页面跳转的时候,后台服务器都会返回一个新的html文档,这种类型的网站也就是多页网站

页面跳转: 返回HTML
优点: 首屏时间快,SEO效果好
缺点: 页面切换慢

在这里插入图片描述
多页和单页应用模式的对比
在这里插入图片描述

PWA(Progressive Web App): 渐进式WEB应用,一个 PWA 应用首先是一个网页, 可以通过 Web 技术编写出一个网页应用. 随后添加上 App Manifest 和 Service Worker 来实现 PWA 的安装和离线等功能

解决了哪些问题

可以添加至主屏幕,点击主屏幕图标
001-前端面试-vue之谈一谈什么是MPA与SPA 前端工程化概念——MPA与SPA 阅读详情

相关推荐

2025前端面试场景题:性能优化、虚拟滚动与架构选型实战

前端开发的本质是在交互体验与渲染性能之间寻找平衡。长列表渲染、请求竞态、首屏加载等问题,要求工程师深入理解浏览器工作原理与框架设计。虚拟滚动通过仅渲染可视区域提升海量数据性能;Vue3组合式API助力状态管理逻辑复用;性能优化以LCP、TBT等指标为基准,配合代码分割与懒加载实现可量化的提升;XSS与CSRF防御、SPA/SSR/PWA选型、微前端协作机制更是架构层面的关键决策。在2025年的技术面试中,这些能力被融入真实场景,例如设计一个支持搜索且能流畅渲染10万条联系人的Vue3列表。这类题目考察的不再

weixin_27605509的博客 271

简单单页应用程序PWA:简单单页应用程序(SPA)和渐进式Web应用程序(PWA)和Materialize&Workbox InjectManifest

简单单页应用程序(SPA) 特征 渐进式Web应用程序(PWA) 索引数据库承诺 物化 工作箱 用法 git clone “在浏览器中执行index.html” 演示版

VLP16:使用pointcloud_to_laserscan将三维点云转化为二维LaserScan

velodyne16线激光雷达 VLP16:使用pointcloud_to_laserscan将三维点云转化为二维LaserScan

NEUer_ljx的博客 4632

《计算机网络》课程大作业- 《小区局域网的设计和规划》

8.1首先,在满足用户需求方面,通过详细的需求分析,充分考虑了居民和物业管理的不同业务需求。对于居民,无论是日常的高清视频播放、在线游戏、远程办公还是智能家居设备的连接,网络都能提供稳定的高速带宽支持。从有线网络的千兆以太网技术保障稳定的有线连接,到无线网络采用 Wi - Fi 6 技术确保无线覆盖区域的高速和低延迟,满足了居民多样化的娱乐和生活需求。对于物业管理,安防监控系统的实时数据传输、物业办公自动化系统的流畅运行以及社区信息的及时发布等业务,都有针对性的网络设计。

lisangsimida的博客 2611

学习笔记9--智能驾驶的功能安全设计之功能安全设计

本系列博客包括6个专栏,分别为:《自动驾驶技术概览》、《自动驾驶汽车平台技术基础》、《自动驾驶汽车定位技术》、《自动驾驶汽车环境感知》、《自动驾驶汽车决策与控制》、《自动驾驶系统设计及应用》。此专栏是关于《自动驾驶系统设计及应用》书籍的笔记.

FUXI_Willard 1807

从贝叶斯网络到结构因果模型:因果推理在可解释AI中的实践

在机器学习和数据分析领域,理解变量间的因果关系而不仅仅是统计关联,是构建可信赖、可解释系统的关键。概率图模型,特别是贝叶斯网络,通过有向无环图和条件概率表,能够高效地编码和推理变量间的条件依赖关系,广泛应用于医疗诊断、风险评估等场景。然而,贝叶斯网络主要刻画的是“是什么”的关联,难以回答“如果…会怎样”的因果问题。为了进行因果推断,需要引入结构因果模型和do-演算,它们通过定义结构方程和模拟干预操作,能够区分混杂效应,估计处理变量对结果变量的净因果影响。这一套方法论对于可解释人工智能至关重要,它能生成反事实

weixin_42168902的博客 389

EDA的未来:当AI与Cadence Virtuoso相遇

本文探讨了AI技术与Cadence Virtuoso在EDA领域的融合,展示了如何通过生成式AI提升芯片设计效率。文章详细分析了Virtuoso设计环境的智能化演进、AI驱动的设计辅助功能实现路径,以及SKILL语言的进化方向,为工程师提供了未来EDA工具的发展趋势和实用案例。

weixin_28312391的博客 677

CANoe信号波形分析保姆级教程:Graphic窗口从配置到实战避坑

本文详细解析了CANoe的Graphic窗口在信号波形分析中的高效配置与实战应用技巧。从信号显示模式选择、测量光标进阶操作到信号分组策略,提供工程化解决方案,帮助工程师快速定位总线信号异常,提升汽车电子开发与测试效率。

weixin_29279047的博客 281

【入门AUTOSAR网络管理测试】AUTOSAR网络管理规范需求解读

AUTOSARAutomotive Open System Architecture,汽车开放系统架构,由全球汽车制造商、部件供应商及其他电子、半导体和软件系统公司联合建立,致力于制定汽车电子软件标准的联盟。网络管理网络管理的目的是使网络中的ECU节点有序的睡眠和唤醒。在没有通信需求的时候睡眠,在需要通信的时候唤醒,可以节约汽车电池的电量。

测试领域技术分享 5187

Vue2+OpenLayers动态绘制两个经纬度并计算距离(提供Gitee源码)

动态绘制两个经纬度并计算它们之间的距离。

黄团团的个人博客 376

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

上一篇: rxjs常见操作符(二)
下一篇: React-Hooks
zhaoandong
博客等级 码龄12年 0粉丝 9原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值