PDA

View Full Version : Headers always no-store, no-cache etc for PHP files?


pcguru
01-14-2007, 05:05 AM
Hi!

I've got some PHP-scripts outputting Javascript code, and they are downloaded and used as javascript files in the eyes of the browser.

By using content-type in a header directive of the php-file litespeed correctly gzips the file the way I want.
<? header ('Content-Type: application/x-javascript'); ?>

The problem is that litespeed always appends these headers for files ending with '.php'
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache

That makes the browsers reload the file every time and it is rather large.
How do I go about making litespeed + PHP output the cache parameters of content-type application/x-javascript instead of for php?

mistwang
01-14-2007, 08:04 AM
I believe those headers was added by PHP, not by LSWS.

pcguru
01-17-2007, 10:52 AM
You are right as usual. :) The headers are created by PHP since I use sessions.
The PHP default setting causing problems is:
session.cache_limiter = nocache
Changing this to "private" solved the issue

mistwang
01-17-2007, 12:30 PM
Thanks for sharing. :)