I am creating a website and I have a static folder served with file server. Problem is when I change something in the static folder it does not update. Even after restarting with go run <file path>.go.
Here is my code:
package main
import (
"log"
"net/http"
/*internal imports*/
)
const Connection = "<temporary way of setting the sql connection string, not related to this problem>"
func main() {
http.HandleFunc("/", server.MainServe) /*server is included in internal imports*/
/*here are more handle function definitions*/
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("<root of a project>/web/static"))))
/*second file server, same definition and the same problem.*/
log.Fatal(http.ListenAndServe(":8080", nil))
}
Welcome to supporting web apps, where 60% of all issues just turn out to be aggressive browser caching. The other 40% are people who lie and say they’re using the latest version of Chrome but are actually using Internet explorer.