unjs / ipx

🖼️ High performance, secure and easy-to-use image optimizer.
MIT License
1.21k stars 58 forks source link

The global maxAge option has no effect in ipx v2. #179

Closed aaharu closed 9 months ago

aaharu commented 9 months ago

Environment

ipx v2.0.0-1

Reproduction

IPX_FS_MAX_AGE=10 npx ipx@next-2 serve --dir ./
# ok! It returns `cache-control`.
# curl -I "http://localhost:3000/_/modal.jpg" 2>&1 | grep -i 'cache'
# cache-control: max-age=10, public, s-maxage=10

IPX_MAX_AGE=10 npx ipx@next-2 serve --dir ./
# ng. It does not return `cache-control`.
# curl -I "http://localhost:3000/_/modal.jpg" 2>&1 | grep -i 'cache'

Describe the bug

sourceMeta is not affected by options. https://github.com/unjs/ipx/blob/v2.0.0-1/src/ipx.ts#L105-L119

Additional context

No response

Logs

No response

pi0 commented 9 months ago

Thanks for notice.