what is style.css?ver=1 tag?

前端 未结 6 1993
温柔的废话
温柔的废话 2020-12-15 06:26

I found out that some websites use css tag like style.css?ver=1. What is this?

What is purpose of ?ver=1?

How do I do it in code?

6条回答
  •  轮回少年
    2020-12-15 06:42

    I think that ?ver=1 is for the version no. of the web app. Every time a new build is created, the app can update the ver to the new version. This is so that the browser will load the new CSS file and not use the cached one (both use different file names).

    You can refer to this site: http://www.knowlegezone.com/36/article/Technology/Software/JavaScript/CSS-Caching-Hack----javascript-as-well

提交回复
热议问题