# Header cache control for CDN

**URL:** <https://www.ruby-forum.com/t/header-cache-control-for-cdn/203702>\
**Category:** NGINX\
**Created:** [February 25, 2011, 12:25pm UTC](https://www.ruby-forum.com/t/header-cache-control-for-cdn/203702 "2011-02-25T12:25:51Z")\
**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 25, 2011, 12:25pm UTC](https://www.ruby-forum.com/t/header-cache-control-for-cdn/203702/1 "2011-02-25T12:25:51Z")

</div>

hi i try to setup akamai cdn i upload all my pictures to CDN server and  
all pictures point out from my website to CDN everything allright but  
they let me put upto 3 days ttl time of images, when i go  
[www.webpagetest.org](http://www.webpagetest.org) the site always warning that because is not 30days  
the address something like  
[http://www.cdntechnologies.com/adsa.34a/mypicture.png](http://www.cdntechnologies.com/adsa.34a/mypicture.png) i want this  
picture expire time to be 30days one of my friend told me can’t override  
because you dont hold images others says you can but dont know how to do  
my conf something like

```
 if ($myrewrite = "AB")
      {
            rewrite /(.+)(style|lightbox)\.css$ /$2.css last;
            rewrite /(.*)(userdata|install|addon|cron\/)(.*)$ /$2$3

```

last;  
rewrite /(._)(js/)(._)$ /$2$3$4 last;  
rewrite ^/(._)(index.php)(/?)(._)$  
/index.php?page=index/$4 last;  
rewrite /(._)(images/)(._)(.)(gif|jpe?g|png|ico)$  
/$2$3$4$5 last;  
rewrite ^/(.\*)$ /index.php?page=$1 last;

```
      }

   location ~ /\.ht { deny all; }
     location ~ /(userdata|images)/ {
        gzip on;
        gzip_min_length 512;
        gzip_types application/xml text/css application/x-javascript

```

text/javascript;  
gzip\_proxied any;  
gzip\_http\_version 1.0;  
root $home\_dir/www/;  
access\_log off;  
expires 30d;  
}

thanks in advance

Posted at Nginx Forum:

> **[Header cache control for CDN](https://forum.nginx.org/read.php?2,178341,178341#msg-178341)**
>
> hi i try to setup akamai cdn i upload all my pictures to CDN server and all pictures point out from my website to CDN everything allright but they let me put upto 3 days ttl time of images, when i go www.webpagetest.org the site always warning that...
