[En-Nut-Discussion] Pictures load very slow
Guido Fischer
gfischer at ispf.de
Sat Jan 7 19:31:11 CET 2006
> I tried it but it is not very effective in my application, since there is
a
> table with much of the same images (some scales, red and green LEDs, etc).
> So it nearly a full update of the page necessary. Only the small header
> section keeps quite then.
>
> But since the pictures are constant it would help alot if the browser
> wouldn't load the pictures every time the page reloads. I thought that the
> browser keeps the pictures in Cache and therefore doesn't load them again
> and again. But my Firefox loads them at every refresh of the page.
To prevent the browser to reload a resource again and again you have to
implement cache control header fields in your HTTP response. Most browser
accept the ETag header field that you have to send with your image. At the
next request, the browser send this value your given back in the HTTP header
and if it's match with your generated ETag, you can send back a "304 Not
Modified" to the browser. It's a part of HTTP/1.1 protocol but most HTTP
clients accept this methode. Otherwise you have to implement time based
cache functions like "If-Modified-Since" etc.
I wonder why this helpful feature isn't implemented in HTTP class of
ethernut source.
Regards
Guido
More information about the En-Nut-Discussion
mailing list