Caching and Compressing of dynamically generated javascript
<p>I am using php for generating javascript dynamically based on different conditions. I want browser to be able to cache it for specific amount of time.</p>

<p>I am using the following code for caching, but it doesn't seem to be working.</p>

<pre><code>header("Content-type: text/javascript; charset: UTF-8");
header("Cache-Control: must-revalidate");
$offset = 60 * 60 ;
$ExpStr = gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
header($ExpStr);
</code></pre>

<p>Also, The js file is quite big, ~290 KBs, So I want to send it compressed to the browser to reduce download time. any suggestions?</p>
