Sorry I don't quite understand -- my go application IS my webserver.

Are you saying Go net/http is not capable of doing what I'm asking?

On Sun, May 19, 2019 at 9:59 AM satyendra singh
<satyendra.singh3...@gmail.com> wrote:
>
> Hi Tong,
> You can use a webserver between browser and your go application which will 
> take care of header modification for browser caching.
>
> Thanks and regards,
> Satyendra
>
> On Sun, 19 May, 2019, 7:26 PM Tong Sun, <suntong...@gmail.com> wrote:
>>
>> Hi,
>>
>> How to have http.Handle / http.HandleFunc to produce static content that 
>> browser will use their caches without downloading every time?
>>
>> For a simplest http.HandleFunc, like the following,
>>
>> func sayHello(w http.ResponseWriter, r *http.Request) {
>>    message := "Hello "
>>
>>    w.Write([]byte(message))
>> }
>>
>>
>>
>> Thet HTTP Header it produce is:
>>
>> HTTP/1.1 200 OK
>> Date: Sun, 19 May 2019 13:46:32 GMT
>> Content-Length: 6
>> Content-Type: text/plain; charset=utf-8
>>
>>
>> I.e., the "Date:" part is changing all the time, even if I've added a 
>> "last-modified" Header field.
>>
>> What's the solution? Thx

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAMmz1OeBW5rp4RcfYtC%3Dk%3DpeX%3DdizF5G9Gv0Y1dgm5%2BG3%3DZBYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to