News for hackers. Stuff that matters.
Re:Go's embed.FS and http.FileServer interact unexpectedly by iron4o on Monday September 30, 2024 @07:33AM (#41695977)
I've noticed that browser caching with Last-Modified and If-Modified-Since is not working on my projects where embed.FS and http.FileServer are used. Which is quite a lot of them.

I guess that my investigation and solution may be helpful to others.

Re:Go's embed.FS and http.FileServer interact unexpectedly by is_taken on Monday September 30, 2024 @09:17AM (#41696776)
Maybe wrapfs.WithModTime(... should not use time.Now() but get the mod time of the running binary?
Re:Go's embed.FS and http.FileServer interact unexpectedly by iron4o on Monday September 30, 2024 @09:58AM (#41697140)
Well, this is left to the application developer to decide and the library should not make the choice for them. In my own application it makes sense to use time.Now(), for example.