当使用,Gitlab页面,呈现我的网站,这是缓慢的页面排名。在GitLab (非企业版)中,我找不到关于如何执行以下操作的解决方案
HTTP Cache Headers,这样就可以缓存它。发布于 2017-12-24 22:45:36
- npm install
- npm run build
- gzip -k -6 -r public
发布于 2020-12-04 14:03:10
如果您已经在“GitLab CI作业”中对压缩资产进行预压缩,则pages支持提供压缩资产。见文件。
请注意,您可以也应该使用brotli压缩,因为它针对web内容进行了优化,并且得到了大多数现代浏览器的支持。
还有一个为您的.gitlab-ci.yml提供建议的片段
pages:
# Other directives
script:
# Build the public/ directory first
- find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec gzip -f -k {} \;
- find public -type f -regex '.*\.\(htm\|html\|txt\|text\|js\|css\)$' -exec brotli -f -k {} \;我还没有找到影响缓存行为的方法。我也在找这个。
https://stackoverflow.com/questions/43795885
复制相似问题