# Wowza Streaming Engine + Cloudfront + nDVR

**URL:** <https://community.wowza.com/t/wowza-streaming-engine-cloudfront-ndvr/47538>\
**Category:** Wowza Streaming Engine\
**Created:** [October 1, 2016, 7:09pm UTC](https://community.wowza.com/t/wowza-streaming-engine-cloudfront-ndvr/47538 "2016-10-01T19:09:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simone\_Mazzoni](https://avatars.discourse-cdn.com/v4/letter/s/d6d6ee/32.png) [@Simone\_Mazzoni](https://community.wowza.com/u/Simone_Mazzoni)\
**Post date:** [October 1, 2016, 7:09pm UTC](https://community.wowza.com/t/wowza-streaming-engine-cloudfront-ndvr/47538/1 "2016-10-01T19:09:46Z")

</div>

Hello,

I’m using WSE to stream via rtsp. All works fine since the stream received by my WSE instance is correctly received and transcoded in HLS as I need.

Since I need to make it accessible to a possibly very large number of viewers, I configured WSE as a live origin application associating it in a cloudfront instance.

In this case I encountered some strange behaviors that are difficult to manage since they are difficult to predict.

The first strange behavior is the fact that if I start to send the rtsp stream to WSE and I start to request the stream through cloudfront, if I try to access too early the “playlist.m3u8” file and I get a 404 error because the playlist isn’t ready yet, I can’t access the playlist from the same client for a certain amount of time (30 seconds or more sometimes). My guess is that subsequent requests to the same playlist are cached for a certain amount of time, so I can’t properly implement a mechanism to play the stream as soon as it became ready.

My question is: is there a proper way to configure both Wowza and Cloudfront to prevent this behavior? I found a tutorial on the internet that suggests to set on cloudfront a minimum TTL of 0 for 404 and 500 errors. Is it the proper way to do this?

I noticed a similar behavior in case I use nDVR with cloudfront. If I request the stream from cloudfront too early, sometimes I get a 404 error not on the “playlist.m3u8” but on the first chunk of the playlist (i.e access “chunklist\_b1396000\_DVR.m3u8” gives me a 404 error) and the x-cache parameter in the response is

```auto
x-cache:Error from cloudfront

```

.

I guess the same as before, maybe I misconfigured my wowza or my cloudfront instances.

Is there a proper way to configure wowza?

Notice that if I request the stream without “?DVR” I never get a 404 error in requesting a chunck.

More in general. Is there exist a tutorial or a guide to deal with wowza + cloudfront cache?

I hope I have been clear.

Is a bit difficult situation to explain. Please ask me if something I wrote is not clear.

Thanks,

Simone

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [November 1, 2016, 4:19pm UTC](https://community.wowza.com/t/wowza-streaming-engine-cloudfront-ndvr/47538/2 "2016-11-01T16:19:59Z")

</div>

Hi,

Yes you can configure the TTL for 404 errors within Cloudfront just as you described, and some customers do do that to remove or reduce 404 responses.

You can find a number of articles on Cloudfront integration with Wowza [here](https://www.wowza.com/docs/cloudfront-integration).

Regards,

Paul
