# Failed to purge media cahce by item name

**URL:** <https://community.wowza.com/t/failed-to-purge-media-cahce-by-item-name/94418>\
**Category:** Wowza Streaming Engine\
**Created:** [January 6, 2022, 3:31pm UTC](https://community.wowza.com/t/failed-to-purge-media-cahce-by-item-name/94418 "2022-01-06T15:31:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vic\_Chien](https://avatars.discourse-cdn.com/v4/letter/v/5f9b8f/32.png) [@Vic\_Chien](https://community.wowza.com/u/Vic_Chien)\
**Post date:** [January 6, 2022, 3:31pm UTC](https://community.wowza.com/t/failed-to-purge-media-cahce-by-item-name/94418/1 "2022-01-06T15:31:27Z")

</div>

Hi All,

Could any one to help me ?

I’m failed to purge cache and got below response.  
**{‘message’: ‘Failed to find xxxxxxx.mp4’, ‘data’: None, ‘success’: False}**

Got item name from `http://127.0.0.1:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/mediacache/stores`  
Purge by `http://127.0.0.1:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/mediacache/stores/actions/flushItemFromCache?filename=xxxxxxx.mp4`

Please refer below for my instruction

1. Got a list of Media Cache store assets via below REST API  
[https://www.wowza.com/docs/media-cache-query-examples#getassetlist](https://www.wowza.com/docs/media-cache-query-examples#getassetlist)

2. Remove a Media Cache store asset via below REST API  
[https://www.wowza.com/docs/media-cache-query-examples#removeassetnotinuse](https://www.wowza.com/docs/media-cache-query-examples#removeassetnotinuse)

Best Regards,  
Vic

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [January 6, 2022, 7:20pm UTC](https://community.wowza.com/t/failed-to-purge-media-cahce-by-item-name/94418/2 "2022-01-06T19:20:53Z")

</div>

Hello! From you description, it’s not clear if you’re including the mediaCache source prefix in the flush request.

We have that in the examples.

`http://127.0.0.1:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/mediacache/stores/actions/flushItemFromCache?filename=` `http/` `asset2.mp4`

In this example only, `http/` is the prefix as default, but you would potentially have to adjust that based on your source.

For example:

Next, refer to the following sections for how to configure common or source-specific properties:

- [Common source properties](https://www.wowza.com/docs/configure-media-cache-properties#common)
- [File source properties](https://www.wowza.com/docs/configure-media-cache-properties#file)
- [HTTP source properties](https://www.wowza.com/docs/configure-media-cache-properties#http)
- [Amazon S3 properties](https://www.wowza.com/docs/configure-media-cache-properties#amazons3)

  

We would need to see more in a support ticket to accurately diagnose.

---

<div class="post-metadata">

**Author:** ![Vic\_Chien](https://avatars.discourse-cdn.com/v4/letter/v/5f9b8f/32.png) [@Vic\_Chien](https://community.wowza.com/u/Vic_Chien)\
**Post date:** [January 7, 2022, 3:16pm UTC](https://community.wowza.com/t/failed-to-purge-media-cahce-by-item-name/94418/3 "2022-01-07T15:16:55Z")

</div>

Hi Rose,

Thanks for your reply.  
I think I using the right item name.  
Because the item name was got from API.  
It’s also include prefix.

Best Regards,  
Vic

---

<div class="post-metadata">

**Author:** ![Rose\_Power-Wowza\_Com](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/rose_power-wowza_com/32/431_2.png) [@Rose\_Power-Wowza\_Com](https://community.wowza.com/u/Rose_Power-Wowza_Com)\
**Post date:** [January 7, 2022, 6:04pm UTC](https://community.wowza.com/t/failed-to-purge-media-cahce-by-item-name/94418/4 "2022-01-07T18:04:10Z")

</div>

Ok thanks, An engineer peeked at this post and wasn’t able to determine if you had or not, but says they will need to fully review your configuration. MediaCache can get pretty detailed and so to accurately diagnose, tech support would like to have a closer look.

Would you please send a support ticket so a Wowza engineer can troubleshoot? Hope we can get this resolved for you and perhaps find a way to automate purging these items. We have a java module to [purge mediacache](https://www.wowza.com/docs/how-to-purge-an-item-from-the-cache-mediacache) that the engineers may suggest some tweaks to for you, but it’ll be based on your infrastructure once they review it.

---

<div class="post-metadata">

**Author:** ![Vic\_Chien](https://avatars.discourse-cdn.com/v4/letter/v/5f9b8f/32.png) [@Vic\_Chien](https://community.wowza.com/u/Vic_Chien)\
**Post date:** [January 8, 2022, 3:07pm UTC](https://community.wowza.com/t/failed-to-purge-media-cahce-by-item-name/94418/5 "2022-01-08T15:07:27Z")

</div>

Hi Rose,

It looks like an issue of encode string format.  
I can flush cache item name in English successfully.  
**Failed to flush item name include Chinese.**  
Could you help to provide an curl example for UTF-8 encoding as below.

```
curl -X PUT \
-H 'Accept:application/json; charset=utf-8' \
-H 'Content-Type:application/json; charset=utf-8' \
"http://127.0.0.1:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/mediacache/stores/actions/flushAndForceItemFromCache?filename=media_prefix/測試影片.mp4"

```

How should I change **測試影片** to what encoding string format.  
Thanks for your support.

Best Regards,  
Vic
