Can I force a refresh of my stylesheet file?

前端 未结 12 2201
-上瘾入骨i
-上瘾入骨i 2020-12-13 18:51

I have just spent half a day quietly going mad.

I\'m making changes to my classes in the Site.css file and they were not being reflected in the site being develope

12条回答
  •  自闭症患者
    2020-12-13 19:33

    A popular way of "cache-breaking" is to append a parameter to your css source. Typically a timestamp is used. I prefer the "file last modified" time, ie. filemtime() in PHP. I'm sure there's an asp.net function that would give you that.

    Then your CSS tag becomes:

    
    

    with the query parameter changing whenever the CSS file is updated.

提交回复
热议问题