# Custom cache control when serving crossdomain.xml ??

**URL:** <https://community.wowza.com/t/custom-cache-control-when-serving-crossdomain-xml/34616>\
**Category:** Wowza Streaming Engine\
**Created:** [May 23, 2014, 2:56pm UTC](https://community.wowza.com/t/custom-cache-control-when-serving-crossdomain-xml/34616 "2014-05-23T14:56:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Guillermo\_Arturo\_Rom](https://avatars.discourse-cdn.com/v4/letter/g/ad7895/32.png) [@Guillermo\_Arturo\_Rom](https://community.wowza.com/u/Guillermo_Arturo_Rom)\
**Post date:** [May 23, 2014, 2:56pm UTC](https://community.wowza.com/t/custom-cache-control-when-serving-crossdomain-xml/34616/1 "2014-05-23T14:56:23Z")

</div>

Hi!

I’d like to specify the cache-control header when serving the crossdomain.xml file.

I tried doing a HTTPProvider that builds and sends this file. However it seems that it always takes the file in the conf directory.

Here’s my VHost.xml configuration for that HTTPProvider:

```auto
<HTTPProviders>
    <HTTPProvider>
        <BaseClass>com.custom.http.HTTPCrossdomain</BaseClass>
        <RequestFilters>*crossdomain.xml</RequestFilters>
	<AuthenticationMethod>none</AuthenticationMethod>
    </HTTPProvider>
(...)
</HTTPProviders>

```

And the HTTPProvider Code (is in another package so it doesn’t collide with wowza.wms)

```auto
public class HTTPCrossdomain extends HTTProvider2Base {
	
	public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp) {
		if (!doHTTPAuthentication(vhost, req, resp))
			return;
		
		StringBuffer response = new StringBuffer();
		response.append("<?xml version=\"1.0\"?>");
		response.append("<!DOCTYPE cross-domain-policy SYSTEM \"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd\">");
		response.append("<cross-domain-policy>");
		response.append("<allow-access-from domain=\"*\"/>");
		response.append("<site-control permitted-cross-domain-policies=\"all\"/>");
		response.append("</cross-domain-policy>");
		try {
			resp.setHeader("Content-Type", "text/xml");
			resp.setHeader("Cache-Control", "foo");
			
			OutputStream out = resp.getOutputStream();
			byte[] outBytes = response.toString().getBytes();
			out.write(outBytes);
		} catch (Exception e) {
			WMSLoggerFactory.getLogger(null).error(
					"ERROR: " + e.toString());
		}
	}
}

```

I’ve tried removing the file at the conf directory but then the server responds with 404. It doesn’t take in consideration the HTTPProvider one 😕

Any help?

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [May 24, 2014, 3:17am UTC](https://community.wowza.com/t/custom-cache-control-when-serving-crossdomain-xml/34616/2 "2014-05-24T03:17:56Z")

</div>

Trying that out, not getting it to work either quite yet. I’ll look more.

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [June 2, 2014, 8:25pm UTC](https://community.wowza.com/t/custom-cache-control-when-serving-crossdomain-xml/34616/3 "2014-06-02T20:25:08Z")

</div>

Getting back to this with more tests, I can confirm. Your HTTPProvider does not run in the 1935 HostPort with RequestFilter “_crossdomain.xml", but it does run with any other RequestFilter, and it does run in the 8086 HostPort with RequestFilter "_.crossdomain.xml”.

We’ve been digging in and are seeing where the issue is, but have a few steps as yet to sort out and take direction to fix. I will update you with any further info, temporary work-around perhaps or patch.

Thanks for the report,

Richard

---

<div class="post-metadata">

**Author:** ![Przemys\_322\_aw\_Sobal](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@Przemys\_322\_aw\_Sobal](https://community.wowza.com/u/Przemys_322_aw_Sobal)\
**Post date:** [October 6, 2015, 7:53am UTC](https://community.wowza.com/t/custom-cache-control-when-serving-crossdomain-xml/34616/4 "2015-10-06T07:53:25Z")

</div>

Hello, is that issue resolved? I can confirm with Wowza Streaming Engine 4.2.0 that “\*crossdomain.xml” filter isn’t working.

---

<div class="post-metadata">

**Author:** ![Przemyslaw\_Sobala](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@Przemyslaw\_Sobala](https://community.wowza.com/u/Przemyslaw_Sobala)\
**Post date:** [March 10, 2017, 10:33am UTC](https://community.wowza.com/t/custom-cache-control-when-serving-crossdomain-xml/34616/5 "2017-03-10T10:33:14Z")

</div>

2 years have passed and still that “\*crossdomain.xml” custom HTTP provider isn’t working with Wowza Streaming Engine 4.6.0… @Richard Lanham are you able to deliver some workaround to set custom cache headers for crossdomain.xml requests?
