joshbuchea / HEAD

A simple guide to HTML <head> elements
https://htmlhead.dev
30k stars 1.92k forks source link

added http-equiv=refresh meta for development purposes #172

Closed jalbertsr closed 7 years ago

jalbertsr commented 7 years ago

I just found a meta that is really useful for development purposes, with <meta http-equiv="refresh" content="1"> every time you save on your code editor after one second your page will refresh displaying the changes made.

This meta should be removed when the project goes to production.

Source: https://code.tutsplus.com/tutorials/4-ways-to-auto-refresh-your-browser-when-designing-new-sites--net-13299

virtual commented 7 years ago

Just a note that this seems to reload every one second infinitely, instead of only when you save your code.

willpower232 commented 7 years ago

The whole purpose of the tag is to refresh the page, it doesn't detect any file changes or anything like that.

The non-developer use of this tag is actually deprecated by W3C https://www.w3.org/TR/WCAG10-HTML-TECHS/#meta-element

Technology is infinitely faster than when this technique was originally put out there and the advent of in-browser development tools and other tools that refresh the browser automatically have more or less obsoleted this technique. Also refreshing the page every second would probably cause the in-browser development tools to lose their place and be barely useful.

jalbertsr commented 7 years ago

Looking at it in more detail you're right, thanks for the clarification.

willpower232 commented 7 years ago

No problem, we're all in this together!