当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 深入了解JS数组的常用方法
- Using lime to explain black box ML model
- 【事件中心 Azure Event Hub】Event Hub日誌種發現的錯誤資訊解讀
- Outlier detection based on RNN self encoder
- 自然语言处理-搜索中常用的bm25
- Using class weight to improve class imbalance
- 基于 Flink SQL CDC 的实时数据同步方案
- 阻塞队列之LinkedBlockingQueue分析
- 给萌新HTML5 入门指南(二)
- windows10 tensorflow(二)原理实战之回归分析,深度学习框架(梯度下降法求解回归参数)
猜你喜欢
随机推荐
计算机TCP/IP面试10连问,你能顶住几道?
自然语言处理-错字识别(基于Python)kenlm、pycorrector
Clean架构能够解决哪些问题? - jbogard
深度解读智能推荐系统搭建之路 | 会展云技术揭秘
面经手册 · 第14篇《volatile 怎么实现的内存可见?没有 volatile 一定不可见吗?》
ES6精华:Proxy & Reflect
让前端攻城师独立于后端进行开发: Mock.js
字符串的常见算法总结
7.3.1 file upload and zero XML registration interceptor
如何在Windows Server 2012及更高版本中将域控制器降级
UML类图还不懂?来看看这版乡村爱情类图,一把学会!
9.2.4 settingselement method (XML configuration builder analysis) - SSM in depth analysis and project practice
网络安全工程师演示:原来***是这样获取你的计算机管理员权限的!【***】
Python3網路學習案例四:編寫Web Proxy
滴滴 Elasticsearch 集群跨版本升级与平台重构之路
天天说要做性能优化,到底在优化什么?
业务策略、业务规则、业务流程和业务主数据之间关系 - modernanalyst
9.2.5 environmentslelement method (XML configuration builder analysis) - SSM in depth analysis and project practice
Gradient understanding decline
适合时间序列数据的计算脚本