Set image caching age

Hi everybody,

I need to set a 7-day caching age for images in their first delivery time and change it to ONE YEAR if it has been used in the next 24 hours.
Please tell me, how can I do this?

Best regards, yours sincerely,
M. Kaloukh

Off the top of my head I would say you have to customize the BinariesServlet. You can configure the BinariesServlet in the web.xml iirc.