Nginx : support des Etags

Boris HUISGEN
|
Depuis sa version 1.3.3, Nginx intégre enfin le support des etags. Ca tombe bien la version 1.4.1 est disponible dans les backports Wheezy et les packages Dotdeb Squeeze/Wheezy. Il n’est donc plus nécessaire d’utiliser un module dédié comme celui-ci :)
Mise en place
Il est nécessaire d’ajouter l’option d’activation dans la directive http, server ou location. Ainsi, pour une application globale :
http {
[...]
etag on;
}
Test
bhuisgen@muse:~$ wget --no-check-certificate --spider --server-response https://localhost/backuppc/image/logo.gif
Spider mode enabled. Check if remote file exists.
--2013-07-18 12:35:59-- https://localhost/backuppc/image/logo.gif
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:443... connected.
WARNING: The certificate of ‘localhost’ is not trusted.
WARNING: The certificate of ‘localhost’ hasn't got a known issuer.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 18 Jul 2013 10:36:00 GMT
Content-Type: image/gif
Content-Length: 1394
Last-Modified: Fri, 07 Jun 2013 10:44:12 GMT
Connection: keep-alive
ETag: "51b1b97c-572"
Accept-Ranges: bytes
Length: 1394 (1.4K) [image/gif]
Remote file exists.