Headers always no-store, no-cache etc for PHP files?

Discussion in 'PHP' started by pcguru, Jan 14, 2007.

  1. pcguru

    pcguru Member


    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?
  2. mistwang

    mistwang LiteSpeed Staff

    I believe those headers was added by PHP, not by LSWS.
  3. pcguru

    pcguru Member

    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
  4. mistwang

    mistwang LiteSpeed Staff

    Thanks for sharing. :)

Share This Page