When coding HTML, browser doesn't always detect changes

前端 未结 6 806
自闭症患者
自闭症患者 2021-01-21 11:11

When I\'m coding HTML and CSS and load the page in the browser to check changes, sometimes it doesn\'t update for a while. This obviously causes problems with incremental change

6条回答
  •  时光说笑
    2021-01-21 11:42

    Hmm could be a web server setting, caching request to your same resource. I used to see that a lot on tomcat with JSP. With tomcat we used to delete compiled classes ('work' folder), though, in your case with PHP you may check your server cache settings (files/sessions).

    Example: "A typical web server, such as Apache, uses the time of file modification to inform a web browser of a requested page’s age, allowing the browser to take appropriate caching action. With dynamic web pages, the actual PHP script may change only occasionally; meanwhile, the content it displays, which is often fetched from a database, will change frequently."

    Source : http://www.sitepoint.com/caching-php-performance/

    Another workaround would be to touch (add a space and save) your PHP file when you want it to reload.

提交回复
热议问题