当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 9.2.3 loadcustomvfs method (XML configuration builder analysis) - SSM in depth analysis and project practice
- Skywalking系列博客1-安装单机版 Skywalking
- vite + ts 快速搭建 vue3 專案 以及介紹相關特性
- 【事件中心 Azure Event Hub】Event Hub日誌種發現的錯誤資訊解讀
- 数据科学家与机器学习工程师的区别? - kdnuggets
- 非常规聚合问题举例
- APReLU:跨界应用,用于机器故障检测的自适应ReLU | IEEE TIE 2020
- 什么是无副作用的函数方法?如何取名? - Mario
- UML类图还不懂?来看看这版乡村爱情类图,一把学会!
- 8.1.2 handling global exceptions through simplemappingexceptionresolver
猜你喜欢
随机推荐
如何成为数据科学家? - kdnuggets
利用类权重来改善类别不平衡
【數量技術宅|金融資料系列分享】套利策略的價差序列計算,恐怕沒有你想的那麼簡單
安装Consul集群
8.1.2 handling global exceptions through simplemappingexceptionresolver
htmlcss
我们编写 React 组件的最佳实践
Big data real-time calculation of baichenghui Hangzhou station
9.2.5 environmentslelement method (XML configuration builder analysis) - SSM in depth analysis and project practice
JUC 包下工具类,它的名字叫 LockSupport !你造么?
Python 基于jwt实现认证机制流程解析
Skywalking系列博客5-apm-customize-enhance-plugin插件使用教程
基于SVM的异常检测方法
8.1.3 handling global exceptions through exceptionhandler (Global exception handling) - SSM in depth analysis and project practice
8.1.1 handling global exceptions through handlerexceptionresolver
如何选择分类模型的评价指标
API 测试利器 WireMock
被产品经理怼了,线上出Bug为啥你不知道
How to select the evaluation index of classification model
今天你写博客了吗?








