gruntjs / grunt-contrib-connect

Start a static web server.
http://gruntjs.com
MIT License
714 stars 146 forks source link

maxAge option not working #162

Closed lnfnunes closed 9 years ago

lnfnunes commented 9 years ago

The maxAge option is not working, always returning max-age=0. Is something wrong ?

Connect config task

simple_server: {
    options: {
        path: '../dist',
        options: {
            maxAge: 604800, //7 days
            keepalive: true
        },
        maxAge: 604800, //7 days
        keepalive: true,
        port: 8000
    }
}

Browser network response

Response Headers
Accept-Ranges:bytes
Cache-Control:public, max-age=0
Connection:keep-alive
content-length:8650
Content-Type:text/html; charset=UTF-8
Date:Tue, 20 Jan 2015 21:48:18 GMT
ETag:W/"2130-1068891131"
Last-Modified:Tue, 20 Jan 2015 21:05:59 GMT

Request Headers
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp
Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8,es;q=0.6,pt;q=0.4,pt-BR;q=0.2
Connection:keep-alive
Host:localhost:8000`
``
sindresorhus commented 9 years ago

It should be inside the base option: https://github.com/gruntjs/grunt-contrib-connect#base