By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,892 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,892 IT Pros & Developers. It's quick & easy.

Does PHP do this differently?

P: n/a
I have a flash app that displays a lot of images that are streamed
through a script running on the website server. Originally this script
was in perl and I would load the image into flash using something
like:

/cgi-bin/image.pl?image=1234

I quickly realized that flash was showing me cached images so I added:

/cgi-bin/image.pl?image=1234&somerandomnumber

And all was good. Now I have rewritten the script in php to open the
file and stream it out with the correct headers and it works fine. But
I want to go back to the caching in flash for certain images that
don't change. So I dropped the randomnumber part but still, every
image is loaded, no cached image is shown. Is it possible that php is
sending some "no-cache" header before I send out my content type
headers? If so, how can I disable it?

Bill H
Oct 31 '08 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Bill H wrote:
I have a flash app that displays a lot of images that are streamed
through a script running on the website server. Originally this script
was in perl and I would load the image into flash using something
like:

/cgi-bin/image.pl?image=1234

I quickly realized that flash was showing me cached images so I added:

/cgi-bin/image.pl?image=1234&somerandomnumber

And all was good. Now I have rewritten the script in php to open the
file and stream it out with the correct headers and it works fine. But
I want to go back to the caching in flash for certain images that
don't change. So I dropped the randomnumber part but still, every
image is loaded, no cached image is shown. Is it possible that php is
sending some "no-cache" header before I send out my content type
headers? If so, how can I disable it?

Bill H
This has nothing to do with PHP It's strictly between your web server
and the client

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Oct 31 '08 #2

P: n/a
Bill H schreef:
I have a flash app that displays a lot of images that are streamed
through a script running on the website server. Originally this script
was in perl and I would load the image into flash using something
like:

/cgi-bin/image.pl?image=1234

I quickly realized that flash was showing me cached images so I added:

/cgi-bin/image.pl?image=1234&somerandomnumber

And all was good. Now I have rewritten the script in php to open the
file and stream it out with the correct headers and it works fine. But
I want to go back to the caching in flash for certain images that
don't change. So I dropped the randomnumber part but still, every
image is loaded, no cached image is shown. Is it possible that php is
sending some "no-cache" header before I send out my content type
headers? If so, how can I disable it?

Bill H
Hi Bill,

If you want to know what a webserver send you, simply inspect the
response from that webserver in detail.
An easy way of doing so is:
1) Install Firefox (ver 3)
2) Install a plugin name Webdeveloper (I use version 1.1.6)

The above steps are advisable for every webdeveloper.

Now:
- Put the url of your image in the Locationfield of FF.
- Click on Webdevelopertaskbar Icon INFORMATION --View Response Headers.

Now you can see all the headers produced by PHP AND your webserver.

Regards,
Erwin Moller

PS: Of course you can do this kind of thing in many other ways, but I
prefer using this simple utility because it has many other useful
functions too.
--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
Oct 31 '08 #3

P: n/a
On Oct 31, 1:17*am, Bill H <b...@ts1000.uswrote:
I have a flash app that displays a lot of images that are streamed
through a script running on the website server. Originally this script
was in perl and I would load the image into flash using something
like:

/cgi-bin/image.pl?image=1234

I quickly realized that flash was showing me cached images so I added:

/cgi-bin/image.pl?image=1234&somerandomnumber

And all was good. Now I have rewritten the script in php to open the
file and stream it out with the correct headers and it works fine. But
I want to go back to the caching in flash for certain images that
don't change. So I dropped the randomnumber part but still, every
image is loaded, no cached image is shown. Is it possible that php is
sending some "no-cache" header before I send out my content type
headers? If so, how can I disable it?

Bill H
If you explicitly set cache-related headers in your script then they
will override the default headers. If you're using FireFox and have
the FireBug extension then take a look at the headers that are being
sent with it. There's also a headers addon for Internet Explorer
called iehttpheaders that you might want to look into. You should
with these tools be able to check that the headers the server is
actually sending are the same as you're expecting.
Oct 31 '08 #4

P: n/a
On 31 Oct, 01:17, Bill H <b...@ts1000.uswrote:
I have a flash app that displays a lot of images that are streamed
through a script running on the website server. Originally this script
was in perl and I would load the image into flash using something
like:

/cgi-bin/image.pl?image=1234

I quickly realized that flash was showing me cached images so I added:

/cgi-bin/image.pl?image=1234&somerandomnumber

And all was good. Now I have rewritten the script in php to open the
file and stream it out with the correct headers and it works fine. But
I want to go back to the caching in flash for certain images that
don't change. So I dropped the randomnumber part but still, every
image is loaded, no cached image is shown. Is it possible that php is
sending some "no-cache" header before I send out my content type
headers? If so, how can I disable it?
You need to get in place the tools to answer this question yourself
(wireshark springs to mind). Yes - in a default config it should do
this. You can define from the PHP code how the browser should handle
caching. But a better solution would be to to have the images served
up by no-cache handler which does a temporary redirect to a cacheable/
non-cacheable image.

C.
Oct 31 '08 #5

P: n/a
On Oct 31, 4:56*am, Gordon <gordon.mc...@ntlworld.comwrote:
On Oct 31, 1:17*am, Bill H <b...@ts1000.uswrote:


I have a flash app that displays a lot of images that are streamed
through a script running on the website server. Originally this script
was in perl and I would load the image into flash using something
like:
/cgi-bin/image.pl?image=1234
I quickly realized that flash was showing me cached images so I added:
/cgi-bin/image.pl?image=1234&somerandomnumber
And all was good. Now I have rewritten the script in php to open the
file and stream it out with the correct headers and it works fine. But
I want to go back to the caching in flash for certain images that
don't change. So I dropped the randomnumber part but still, every
image is loaded, no cached image is shown. Is it possible that php is
sending some "no-cache" header before I send out my content type
headers? If so, how can I disable it?
Bill H

If you explicitly set cache-related headers in your script then they
will override the default headers. If you're using FireFox and have
the FireBug extension then take a look at the headers that are being
sent with it. *There's also a headers addon for Internet Explorer
called iehttpheaders that you might want to look into. *You should
with these tools be able to check that the headers the server is
actually sending are the same as you're expecting.- Hide quoted text -

- Show quoted text -
Thanks Gordon and C. I wasn't sure if there was a cache issue, I threw
that in there cause I read about it in another thread. I checked and
there is a "no-cache" in the php.ini and I am having the web admin
remove that.

Bill H
Oct 31 '08 #6

P: n/a
On 31 Oct, 15:08, Bill H <b...@ts1000.uswrote:
On Oct 31, 4:56 am, Gordon <gordon.mc...@ntlworld.comwrote:
On Oct 31, 1:17 am, Bill H <b...@ts1000.uswrote:
I have a flash app that displays a lot of images that are streamed
through a script running on the website server. Originally this script
was in perl and I would load the image into flash using something
like:
/cgi-bin/image.pl?image=1234
I quickly realized that flash was showing me cached images so I added:
/cgi-bin/image.pl?image=1234&somerandomnumber
And all was good. Now I have rewritten the script in php to open the
file and stream it out with the correct headers and it works fine. But
I want to go back to the caching in flash for certain images that
don't change. So I dropped the randomnumber part but still, every
image is loaded, no cached image is shown. Is it possible that php is
sending some "no-cache" header before I send out my content type
headers? If so, how can I disable it?
Bill H
If you explicitly set cache-related headers in your script then they
will override the default headers. If you're using FireFox and have
the FireBug extension then take a look at the headers that are being
sent with it. There's also a headers addon for Internet Explorer
called iehttpheaders that you might want to look into. You should
with these tools be able to check that the headers the server is
actually sending are the same as you're expecting.- Hide quoted text -
- Show quoted text -

Thanks Gordon and C. I wasn't sure if there was a cache issue, I threw
that in there cause I read about it in another thread. I checked and
there is a "no-cache" in the php.ini and I am having the web admin
remove that.

Bill H
no - this is not the way to change the caching - issue your own
caching instructions from inside PHP

C.
Nov 2 '08 #7

This discussion thread is closed

Replies have been disabled for this discussion.