当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- Python爬蟲實戰詳解:爬取圖片之家
- 阿里CCO项目组面试的思考
- H5打造属于自己的视频播放器(JS篇2)
- 9.2.2 parse and parseconfiguration method (XML configuration builder analysis) - SSM in depth analysis and project practice
- keras model.compile损失函数与优化器
- 如何在Windows Server 2012及更高版本中将域控制器降级
- 如何使用ES6中的参数
- Anomaly detection method based on SVM
- 使用ES5实现ES6的Class
- 让人怪不好意思的,粉丝破万,用了1年!
猜你喜欢
随机推荐
看完这篇就看懂了很多webpack脚手架
nlp模型-bert从入门到精通(一)
8.1.2 handling global exceptions through simplemappingexceptionresolver
适合时间序列数据的计算脚本
深度解读智能推荐系统搭建之路 | 会展云技术揭秘
企业数据库的选择通常由系统架构师主导决策 - thenewstack
Using lime to explain black box ML model
9.2.4 settingselement method (XML configuration builder analysis) - SSM in depth analysis and project practice
ES6精华:Proxy & Reflect
9.2.3 loadcustomvfs method (XML configuration builder analysis) - SSM in depth analysis and project practice
为什么民营企业要做党建?——极客邦控股党支部专题学习
Cocos Creator 源码解读:引擎启动与主循环
JVM Metaspace内存溢出排查与总结
给萌新HTML5 入门指南(二)
从零学习人工智能,开启职业规划之路!
今天你写博客了吗?
Electron应用使用electron-builder配合electron-updater实现自动更新
基于RNN自编码器的离群点检测
7.2.1 配置静态资源的缓存 -《SSM深入解析与项目实战》
聆听无声的话语:手把手教你用ModelArts实现手语识别