当前位置:网站首页>7.2.2 compressing static resources through gzipresourceresolver
7.2.2 compressing static resources through gzipresourceresolver
2020-11-06 01:14:00 【Memory】
All the source code in the project can be found in the linked repository :https://github.com/chenhaoxiang/uifuture-ssm
List of articles
7.2.2 adopt GzipResourceResolver Compress static resources
The previous use of cache , But the first time the file is loaded, it will not go to the cache . In order to reduce the amount of data transferred , In this case, resource compression is needed . Modern browsers , Basically, it's all about supporting gzip Agreed , Support client decompression processing , The main purpose is to reduce the amount of transmission , Speed up . For example, put the front of bootstrap.css Compress it into bootstrap.css.gz.
GZIP Compression is Linux The compression method commonly used in . stay Linux Under the system , You can use the command to recurse the files in the directory and compress each file in the directory separately .”gzip -r /java/static/”, That is, traversal compression /java/static/ All the files in the directory . Be careful , The source file will be deleted .
But in the case of files being compressed , If you load directly bootstrap.css,Spring MVC It can't be handled normally , We hope to ask for bootstrap.css When it's time to return correctly bootstrap.css.gz. At this time, you need to add a resource parser to handle compression (GzipResourceResolver).
Code list 7-16:MvcConfig Class addResourceHandlers Method
版权声明
本文为[Memory]所创,转载请带上原文链接,感谢
边栏推荐
- 用TensorFlow预测纽约市AirBnB租赁价格
- 阻塞队列之LinkedBlockingQueue分析
- 【C/C++ 1】Clion配置与运行C语言
- 7.3.2 文件下载&大文件的下载 -《SSM深入解析与项目实战》
- 计算机TCP/IP面试10连问,你能顶住几道?
- 6.9.2 SessionFlashMapManager分析(FlashMapManager重定向管理) -《SSM深入解析与项目实战》
- 使用Consul实现服务发现:instance-id自定义
- PMP考试心得
- 9.1 sqlsessionfactorybuilder - SSM in depth analysis and project practice
- 非常规聚合问题举例
猜你喜欢
随机推荐
写一个通用的幂等组件,我觉得很有必要
如何在Windows Server 2012及更高版本中将域控制器降级
想要做读写分离,送你一些小经验
7.2.2 通过GzipResourceResolver压缩静态资源 -《SSM深入解析与项目实战》
Jumpserver高可用集群部署:(六)SSH代理模块koko部署并实现系统服务管理
8.1.1 handling global exceptions through handlerexceptionresolver
适合时间序列数据的计算脚本
自然语言处理-错字识别(基于Python)kenlm、pycorrector
nlp模型-bert从入门到精通(一)
权重不确定的概率线性回归
自然语言处理-搜索中常用的bm25
【jmeter】實現介面關聯的兩種方式:正則表示式提取器和json提取器
看完这篇就看懂了很多webpack脚手架
7.2.3 GZIP一键压缩工具 -《SSM深入解析与项目实战》
TF flags的简介
利用 AWS SageMaker BlazingText 对不均衡文本进行多分类
Polkadot系列(二)——混合共识详解
微服务 - 如何解决链路追踪问题
PMP考试心得
經典動態規劃:完全揹包問題






