The only way is to create script which downloads contents from external site and then adds needed headers.
<script type="text/javascript" src="http://external.example.com/foo.js"></script>
To
<script type="text/javascript" src="external.php?url=http://external.example.com/foo.js"></script>
And external.php is something like
<?php
header("Expire-stuff: something");
echo file_get_contents($_GET['url']);
Of course this has security hole so I'd recommend to use identifier strings like external.php?file=foo.js and then using
$files = array('foo.js' => 'http://external/...');
if(isset($files[$_GET['file']]))
{
echo file_get_contents($files[$_GET['file']]);
}
file_get_contents() of course will take some of your bandwith so it would be recommended to cache the result also.