# Problems setting ttl on single image

**URL:** <https://www.ruby-forum.com/t/problems-setting-ttl-on-single-image/238262>\
**Category:** NGINX\
**Created:** [December 30, 2013, 1:03am UTC](https://www.ruby-forum.com/t/problems-setting-ttl-on-single-image/238262 "2013-12-30T01:03:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [December 30, 2013, 1:03am UTC](https://www.ruby-forum.com/t/problems-setting-ttl-on-single-image/238262/1 "2013-12-30T01:03:49Z")

</div>

I’m trying to enable a 10 minute autorefresh for my webcam which you can  
see at [http://www.diamondharbour.org.nz/Local-Weather.html](http://www.diamondharbour.org.nz/Local-Weather.html)

Server runs nginx 1.4.4 ( and an ancient CMS called Etomite ).

Here’s the WPT result [WebPageTest Test - Running web page performance and optimization tests...](http://www.webpagetest.org/result/131229_HV_MK2/)

Here’s a snippet of my config…

```
    location = /assets/Photo\ Gallery/Weather/current\.jpg {
            expires 10m;
            log_not_found off;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires max;
            log_not_found off;
    }

```

Why is is not setting a 10 minute expiry - the webpagetest report should  
pick up on it??? I’m sort of expecting that it may have something to do  
with the space in the URL?

Any pointers gratefully received (:

## Steve

Steve H. BSc(Hons) MIITP

> **[Linux & Admin Support Services | "Services provided by people who are...](https://www.greengecko.co.nz/)**
>
> Offers linux support services, systems and database administration, consultancy and the full development lifecycle for open source - based solutions

Linkedin: [http://www.linkedin.com/in/steveholdoway](http://www.linkedin.com/in/steveholdoway)  
Skype: sholdowa

---

<div class="post-metadata">

**Author:** ![steveybaby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@steveybaby](https://www.ruby-forum.com/u/steveybaby)\
**Post date:** [December 30, 2013, 2:06am UTC](https://www.ruby-forum.com/t/problems-setting-ttl-on-single-image/238262/2 "2013-12-30T02:06:21Z")

</div>

> Here’s a snippet of my config…
> 
> ```
> location = /assets/Photo\ Gallery/Weather/current\.jpg {
> expires 10m;
> log_not_found off;
> }
> 
> ```

The “location =” syntax does not use regular expressions. You may also  
want to surround the string with quotes if it contains spaces rather  
than escaping spaces.

---

<div class="post-metadata">

**Author:** ![steveybaby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c57346/32.png) [@steveybaby](https://www.ruby-forum.com/u/steveybaby)\
**Post date:** [December 30, 2013, 2:57am UTC](https://www.ruby-forum.com/t/problems-setting-ttl-on-single-image/238262/3 "2013-12-30T02:57:15Z")

</div>

On Mon, 2013-12-30 at 02:05 +0100, Richard S. wrote:

> than escaping spaces.

Yup, that fixed it thanks!

Cheers,

## Steve

Steve H. BSc(Hons) MIITP

> **[Linux & Admin Support Services | "Services provided by people who are...](https://www.greengecko.co.nz/)**
>
> Offers linux support services, systems and database administration, consultancy and the full development lifecycle for open source - based solutions

Linkedin: [http://www.linkedin.com/in/steveholdoway](http://www.linkedin.com/in/steveholdoway)  
Skype: sholdowa
