what is style.css?ver=1 tag?

前端 未结 6 2014
温柔的废话
温柔的废话 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:52

    IMO a better way to do this would be to include a hash generated off of the file size or a checksum based on the file contents or last-modified date. That way you don't have to update some version number and just let the number be driven off of the file's changing properties.

提交回复
热议问题