CSS file not refreshing in browser

前端 未结 15 1316
旧时难觅i
旧时难觅i 2020-11-29 04:55

When I make any changes to my CSS file, the changes are not reflected in the browser. How can I fix this?

15条回答
  •  猫巷女王i
    2020-11-29 05:36

    Having this problem before I found out my own lazy solution (based on other people suggestions). It should be helpful if your contents go through php interpreter.

    To force downloading file every time you make changes to it, you could add file byte size of this file after question mark sign at the end.

    
    

    EDIT: As suggested in comments, filemtime() is actually a better solution as long as your files have properly updated modify time (I, myself, have experienced such issues in the past, while working with remote files):

    
    

提交回复
热议问题