status 304 (not modified)
This commit is contained in:
parent
4f6e9e5c7c
commit
06458065d6
1 changed files with 4 additions and 0 deletions
|
|
@ -108,6 +108,10 @@ func StaticHandler(rw http.ResponseWriter, req *http.Request) {
|
|||
|
||||
if assets != nil {
|
||||
if asset, ok := assets[path]; ok {
|
||||
if req.Header.Get("if-none-match") == asset.etag {
|
||||
rw.WriteHeader(http.StatusNotModified)
|
||||
return
|
||||
}
|
||||
rw.Header().Set("Content-Type", ctype)
|
||||
rw.Header().Set("Content-Encoding", "gzip")
|
||||
rw.Header().Set("Etag", asset.etag)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue