# Expiration header not being set?

**URL:** <https://www.ruby-forum.com/t/expiration-header-not-being-set/203392>\
**Category:** NGINX\
**Created:** [February 19, 2011, 12:52am UTC](https://www.ruby-forum.com/t/expiration-header-not-being-set/203392 "2011-02-19T00:52:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 19, 2011, 12:52am UTC](https://www.ruby-forum.com/t/expiration-header-not-being-set/203392/1 "2011-02-19T00:52:05Z")

</div>

The location snippet below works except the expiration header is not  
being  
set. The request is made using this kind of URL:

/assets/abcdef/js/my.js

If the JS file is not found in memcached, it gets redirected to  
static.php  
which loads the static file into memory. Do we need to include the  
headers  
in the file itself as its being loaded from memcached?

location ~ /assets/([a-zA-Z0-9]+)(/.+) {  
expires max;  
set $memcached\_key “$1\_$2”;  
memcached\_pass localhost:11211;  
error\_page 404 =200  
/libraries/asset\_filter/client/static.php?hash=$1&uri=$2;  
}

Thanks
