I'm using W3 Total Cache's CDN connection to RackSpace CloudFiles to serve severall hundred media files. My goal is to get the files to download in the user's browser, rather than stream. According to the CloudFiles Documentation (http://docs.rackspacecloud.com/files/api/v1/cf-devguide-20111115.pdf) I can set the Content Disposition headers.

Does anyone know how this can be done via W3 Total Cache or, perhaps, around with it? Or, alternatively, do you know of another way to force downloads for files served via the CDN?

I was taking a look at the file w3-total-cache\lib\CF\cloudfiles.php and there are some functions over there that allow to pass the header. I think that is too technical to be resolved for free. It's doable but would take much more time then just a simple answer, and W3 Total Cache does a poor job on filters and actions to plug new functionality, so you would need to fork the plugin or create something from the scratch.
–
WebordFeb 24 '12 at 3:34

This will add the proper header to force the download if W3TC is fetching an object with a file extension listed in the regex above. This is a good way to control what files are served in the browser and what files have to be downloaded.

You can try this out in a plugin I created for your convenience. This may need some tweaking, but this is how I feel you should approach the issue.

As a final note, this obviously edits the core of the W3TC plugin (though with just one line of code). This isn't a best practice, but it will work for you. This means any upgrade will override your changes. It might be prudent to rename the plugin (create a fork on your system) so WordPress doesn't try to update it.

This feels like it's really close.. Any ideas for troubleshooting? Firebug may be of help, I'm just still relatively new at it. Any ideas are welcomed, otherwise, I will keep experimenting and report back.
–
Jonathan WoldFeb 28 '12 at 12:32

I looked into it further and noticed that MP3 was missing in the preg_match. Added it, no success yet.
–
Jonathan WoldFeb 28 '12 at 12:50