[Mod_gzip] Mod_gzip and Cache-Control No Cache
mod_gzip@lists.over.net
mod_gzip@lists.over.net
Thu, 13 Nov 2003 03:31:37 EST
--part1_1d9.1436eed3.2ce49b69_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
Hi John...
Kevin again...
> Thanks for the help. I got past the caching already.
That's great... but would you mind letting us all know
what 'got you past it'? When people resolve issues they
have posted around here we like there to be an
explanation for the sake of maybe other people running
into the same thing in the future.
What did you do to 'get past the caching' (problem)?
> I do have another problem.
I hear ya. If it ain't one thing it's another. ROFL
> My PHP page are being store in the Temporary Internet Files
> folder. Although I am using PHP, when I look in the temp I see
> the files but its in html format. I saw a couple of posts on this
> but no reply.
>
> Basically i dont want m php pages being store in the users temp
> internet files folder. With modzip off, it works like a charm, wih it
> on, it stores it as html. Really strange.
I think I have an explanation for you but I don't think you
are going to like it.
What most people don't realize is that all modern browsers
that support 'decompression' are actually using their own
local caches to get the job done. As the data arrives it is
'written' into a cache file locally and then they launch a
thread which calls ZLIB ( or the equivalent ) to start
decompressing the data being received. Even if the Server
is 'streaming' the compressed data it's still being written
into a 'workfile' on the disk and then the REAL ( decompressed )
HTML page is being 'assembled' in another cache file as
ZLIB works on the workfile.
What I think you are seeing is just another bug in MSIE.
I believe you are seeing a situation where MSIE has
ended up ignoring all cache-control directives and you
are simply seeing the .html 'workfile' that MSIE came
up with while it was decompressing the original URI.
Netscape is no better... and actually it's worse.
Netscape ends up keeping BOTH files around in its
'Temporary Internet Files' cache. It even goes brain
dead sometimes and tries to use the original compressed
cache file like when you tell Netscape to 'print' any
page that arrived with compression. It 'forgets' that it
did any decompression when it's on that control path
and it stupidly tries to print the compressed file from
it's own cache because it's still 'hanging around'.
MSIE will always delete the original compressed
workfile in 'Temporary Internet Folders' but ( as you
are seeing ) the resulting 'decompressed' page
hangs around regardless of cache directives.
The reason it all works when there is no compression
is because nothing has short-circuited the cache
control because this whole 'use a work file' thing
never kicked in.
My only advice is the same as before.
Try using "Expires: -1" in the response header.
If MSIE still keeps a 'copy' of the response in its
own local cache when it shows up with "Expires: -1"
then it is truly, truly broken.
Later...
Kevin
In a message dated 11/13/2003 12:02:54 AM Central Standard Time,
john@impaqads.com writes:
> Hi Kevin
>
> Thanks for the help. I got past the caching already but I do have another
> problem. My PHP page are being store in the Temporary Internet Files folder.
> Although I am using PHP, when I look in the temp I see the files but its in
> html format. I saw a couple of posts on this but no reply.
>
> Basically i dont want m php pages being store in the users temp internet
> files folder. With modzip off, it works like a charm, wih it on, it stores it
> as html. Really strange.
>
> Any suggestions would be extremely appreciated.
>
> Thanks
>
> John
>
> >> ----- Original Message -----
>> From: <A HREF="mailto:TOKILEY@aol.com">TOKILEY@aol.com</A>
>> To: <A HREF="mailto:mod_gzip@lists.over.net">mod_gzip@lists.over.net</A>
>> Cc: <A HREF="mailto:john@impaqads.com">john@impaqads.com</A> ; <A HREF="mailto:TOKILEY@aol.com">TOKILEY@aol.com</A>
>> Sent: Thursday, November 13, 2003 12:32 PM
>> Subject: Re: [Mod_gzip] Mod_gzip and Cache-Control No Cache
>>
>>
>>
>> Hi John...
>> This is Kevin Kiley...
>>
>> Why not just add "Expires: -1" to the response header
>> for anything you don't want cached? ( PHP scripts only? ).
>>
>> AFAIK there is no proxy cache on the planet that will
>> ever cache anything if it has "Expires: -1" on the
>> response. All the 'other' cache control directives
>> ( especially the pragma stuff ) is 'iffy'. Sometimes
>> it functions as advertised, sometimes not. Depends
>> on the software.
>>
>> If I recall... MSIE is famous for ignoring 'pragma: no-cache'
>> but "Expires: -1" works even with MSIE.
>>
>> Later...
>> Kevin
>>
>> In a message dated 11/12/2003 5:54:31 PM Central Standard Time,
>> john@impaqads.com writes:
>>
>>
>> >>> Hi Can Anyone please help me.
>>>
>>> I recently upgraded apche and now have installed mod_gzip. Mod_gzip is
>>> working but for some reason the following headers are no longer working.
>>>
>>> Header('Cache-Control: no-cache');
>>> Header('Pragma: no-cache');
>>> Header("P3P: CP=NOI NID CURa OUR NOR UNI");
>>>
>>> When I turn off mod_gzip i can get them to work and my pages dont cache.
>>> What i basically want is to get mod_gzip working and my php scripts not to
>>> cache. Please help, i've tried everything and no can help me.
>>>
>>> Regards
>>>
>>> John
>>>
>>>
>>
>>
>
--part1_1d9.1436eed3.2ce49b69_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<HTML><FONT FACE=3Darial,helvetica><FONT SIZE=3D2><BR>
Hi John...<BR>
Kevin again...<BR>
<BR>
> Thanks for the help. I got past the caching already.<BR>
<BR>
That's great... but would you mind letting us all know<BR>
what 'got you past it'? When people resolve issues they<BR>
have posted around here we like there to be an<BR>
explanation for the sake of maybe other people running<BR>
into the same thing in the future.<BR>
<BR>
What did you do to 'get past the caching' (problem)?<BR>
<BR>
> I do have another problem. <BR>
<BR>
I hear ya. If it ain't one thing it's another. ROFL<BR>
<BR>
> My PHP page are being store in the Temporary Internet Files <BR>
> folder. Although I am using PHP, when I look in the temp I see <BR>
> the files but its in html format. I saw a couple of posts on this <BR>
> but no reply. </FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND=
-COLOR: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"><BR=
>
> <BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">> Basically i dont want m=
php pages being store in the users temp <BR>
> internet files folder. With modzip off, it works like a charm, wi=
h it <BR>
> on, it stores it as html. Really strange. <BR>
<BR>
I think I have an explanation for you but I don't think you<BR>
are going to like it.<BR>
<BR>
What most people don't realize is that all modern browsers <BR>
that support 'decompression' are actually using their own<BR>
local caches to get the job done. As the data arrives it is<BR>
'written' into a cache file locally and then they launch a <BR>
thread which calls ZLIB ( or the equivalent ) to start <BR>
decompressing the data being received. Even if the Server<BR>
is 'streaming' the compressed data it's still being written<BR>
into a 'workfile' on the disk and then the REAL ( decompressed )<BR>
HTML page is being 'assembled' in another cache file as<BR>
ZLIB works on the workfile.<BR>
<BR>
What I think you are seeing is just another bug in MSIE.<BR>
I believe you are seeing a situation where MSIE has<BR>
ended up ignoring all cache-control directives and you <BR>
are simply seeing the .html 'workfile' that MSIE came<BR>
up with while it was decompressing the original URI.<BR>
<BR>
Netscape is no better... and actually it's worse.<BR>
<BR>
Netscape ends up keeping BOTH files around in its<BR>
'Temporary Internet Files' cache. It even goes brain<BR>
dead sometimes and tries to use the original compressed<BR>
cache file like when you tell Netscape to 'print' any<BR>
page that arrived with compression. It 'forgets' that it<BR>
did any decompression when it's on that control path<BR>
and it stupidly tries to print the compressed file from<BR>
it's own cache because it's still 'hanging around'.<BR>
<BR>
MSIE will always delete the original compressed <BR>
workfile in 'Temporary Internet Folders' but ( as you<BR>
are seeing ) the resulting 'decompressed' page <BR>
hangs around regardless of cache directives.<BR>
<BR>
The reason it all works when there is no compression<BR>
is because nothing has short-circuited the cache <BR>
control because this whole 'use a work file' thing<BR>
never kicked in.<BR>
<BR>
My only advice is the same as before.<BR>
<BR>
Try using "Expires: -1" in the response header.<BR>
<BR>
If MSIE still keeps a 'copy' of the response in its<BR>
own local cache when it shows up with "Expires: -1"<BR>
then it is truly, truly broken.<BR>
<BR>
Later...<BR>
Kevin<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
In a message dated 11/13/2003 12:02:54 AM Central Standard Time, john@impaqa=
ds.com writes:<BR>
<BR>
<BR>
<BLOCKQUOTE TYPE=3DCITE style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT=
: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">Hi Kevin</FONT><FONT COLOR=3D"=
#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERIF" F=
ACE=3D"Arial" LANG=3D"0"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">Thanks for the help. I got p=
ast the caching already but I do have another problem. My PHP page are being=
store in the Temporary Internet Files folder. Although I am using PHP, when=
I look in the temp I see the files but its in html format. I saw a couple o=
f posts on this but no reply. </FONT><FONT COLOR=3D"#000000" style=
=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERIF" FACE=3D"Arial"=20=
LANG=3D"0"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">Basically i dont want m php=20=
pages being store in the users temp internet files folder. With modzip=
off, it works like a charm, wih it on, it stores it as html. Really strange=
. </FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=
=3D3 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">Any suggestions would be ext=
remely appreciated. </FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLO=
R: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">Thanks </FONT><FONT COLOR=
=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERI=
F" FACE=3D"Arial" LANG=3D"0"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">John</FONT><FONT COLOR=3D"#=
000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERIF" FA=
CE=3D"Arial" LANG=3D"0"><BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"><BR>
<BLOCKQUOTE TYPE=3DCITE style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT=
: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">----- Original Message ----- <B=
R>
<B>From:</B> <A HREF=3D"mailto:TOKILEY@aol.com">TOKILEY@aol.com</A> <BR>
<B>To:</B> <A HREF=3D"mailto:mod_gzip@lists.over.net">mod_gzip@lists.over.ne=
t</A> <BR>
<B>Cc:</B> <A HREF=3D"mailto:john@impaqads.com">john@impaqads.com</A> ; <A H=
REF=3D"mailto:TOKILEY@aol.com">TOKILEY@aol.com</A> <BR>
<B>Sent:</B> Thursday, November 13, 2003 12:32 PM<BR>
<B>Subject:</B> Re: [Mod_gzip] Mod_gzip and Cache-Control No Cache<BR>
<BR>
<BR>
<BR>
Hi John...<BR>
This is Kevin Kiley...<BR>
<BR>
Why not just add "Expires: -1" to the response header<BR>
for anything you don't want cached? ( PHP scripts only? ).<BR>
<BR>
AFAIK there is no proxy cache on the planet that will<BR>
ever cache anything if it has "Expires: -1" on the<BR>
response. All the 'other' cache control directives<BR>
( especially the pragma stuff ) is 'iffy'. Sometimes<BR>
it functions as advertised, sometimes not. Depends<BR>
on the software.<BR>
<BR>
If I recall... MSIE is famous for ignoring 'pragma: no-cache'<BR>
but "Expires: -1" works even with MSIE.<BR>
<BR>
Later...<BR>
Kevin<BR>
<BR>
In a message dated 11/12/2003 5:54:31 PM Central Standard Time, john@impaqad=
s.com writes:<BR>
<BR>
<BR>
<BLOCKQUOTE TYPE=3DCITE style=3D"BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT=
: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">Hi Can Anyone please help me.</=
FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3 F=
AMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">I recently upgraded apche an=
d now have installed mod_gzip. Mod_gzip is working but for some reason the f=
ollowing headers are no longer working.</FONT><FONT COLOR=3D"#000000" style=
=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERIF" FACE=3D"Arial"=20=
LANG=3D"0"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">Header('Cache-Control: no-ca=
che');<BR>
Header('Pragma: no-cache');<BR>
Header("P3P: CP=3DNOI NID CURa OUR NOR UNI");</FONT><FONT COLOR=3D"#000000"=
style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERIF" FACE=3D"A=
rial" LANG=3D"0"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">When I turn off mod_gzip i c=
an get them to work and my pages dont cache. What i basically want is=20=
to get mod_gzip working and my php scripts not to cache. Please help, i've t=
ried everything and no can help me.</FONT><FONT COLOR=3D"#000000" style=3D"=
BACKGROUND-COLOR: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=
=3D"0"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">Regards</FONT><FONT COLOR=
=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERI=
F" FACE=3D"Arial" LANG=3D"0"><BR>
<BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0">John </FONT><FONT COLOR=3D"=
#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3 FAMILY=3D"SANSSERIF" F=
ACE=3D"Arial" LANG=3D"0"><BR>
<BR>
</BLOCKQUOTE><BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D2=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"><BR>
</FONT><FONT COLOR=3D"#000000" style=3D"BACKGROUND-COLOR: #ffffff" SIZE=3D3=
FAMILY=3D"SANSSERIF" FACE=3D"Arial" LANG=3D"0"></BLOCKQUOTE><BR>
</BLOCKQUOTE><BR>
<BR>
</FONT></HTML>
--part1_1d9.1436eed3.2ce49b69_boundary--