# S-maxage header

**URL:** <https://www.ruby-forum.com/t/s-maxage-header/236448>\
**Category:** NGINX\
**Created:** [September 4, 2013, 9:55am UTC](https://www.ruby-forum.com/t/s-maxage-header/236448 "2013-09-04T09:55:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [September 4, 2013, 9:55am UTC](https://www.ruby-forum.com/t/s-maxage-header/236448/1 "2013-09-04T09:55:31Z")

</div>

Hi,

What’s the easiest way to set the s-maxage header correctly?

For example to set s-maxage to 365 days inside a location statement that  
matches images, JS and CSS files. This is needed so that the proxy will  
cache the file but the client won’t.

Posted at Nginx Forum:

> **[s-maxage header](https://forum.nginx.org/read.php?2,242514,242514#msg-242514)**
>
> Hi, What's the easiest way to set the s-maxage header correctly? For example to set s-maxage to 365 days inside a location statement that matches images, JS and CSS files. This is needed so that the proxy will cache the file but the client won't.
