[eluser]bwuk[/eluser]
Hi,
I'm using CI to generate some dynamic javascript files. It all works fine, with no problems.
However, I'm now trying to cache the javascript files. I'm running on apache, and I've added the following to my .htaccess file:
Code:
SetOutputFilter DEFLATE
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|rpm|ico|iso|gz|bz2)$ no-gzip dont-vary
Header append Vary User-Agent env=!dont-vary
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=290304000, public"
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
</FilesMatch>
For the dynamic javascript files, they're not being cached. However, if have a 'standard' javascript file, that is being cached.
For example, my dynamic javascript file path may be:
and for the 'standard' javascript file:
and I have the following setup in my .htaccess for mod_rewrite:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|scripts|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
So, is CI doing something special with my dynamic javascript files? sending some wrong headers? content type etc?
Thanks
bwuk