In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "the configuration steps of disabling browser caching in vue project". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn the configuration steps of disabling browser caching in the vue project.
Project releases often encounter problems that need to clean the cache. Here is the actual way to disable caching for a project
Modify the index.html file meta configuration in the 1.public folder
2.vue cli build configuration (for vue3 below)
Add new configuration in vue.config.js
Const Timestamp = new Date () .getTime () module.exports = {configureWebpack: {output: {/ / output refactoring packaged compiled file name [module name. Version number (optional). Timestamp] filename: `[name]. ${Timestamp} .js`, chunkFilename:` [name]. ${Timestamp} .js`},}, css: {extract: {/ / packaged css file name add timestamp filename: `css/ [name]. ${Timestamp} .css`, chunkFilename: `css/ [name]. ${Timestamp} .css`},},}
3.Nginx configuration
Disable nginx caching and let the browser request the file every time it goes to the server instead of reading the cache file in the browser.
When the program is debugged and put online, you can turn on the nginx cache, save the server's bandwidth traffic, reduce some requests, and reduce the pressure on the server.
Configure the html file in the nginx.conf file by default plus header does not cache the configuration
The nginx cache configuration in the following actual project
Location ~. *\. (?: htm | html) ${add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";}
Nginx static resource cache settings https://codecat.blog.csdn.net/article/details/117604817
At this point, I believe you have a deeper understanding of the "configuration steps to disable browser caching in the vue project". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.