473,409 Members | 2,022 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Does PHP do this differently?

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
6 1444
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: oom | last post by:
I am a bit of a newbie when it comes to python, when working with lists today I noticed some very odd behaviour, any suggestions welcome: Python 2.2.3 (#1, Nov 6 2003, 14:12:38) on linux2...
3
by: for.fun | last post by:
Hi everybody, I am looking for a XML comparison tool (I do not mean a standard char-by-char diff tool but a tool which understand XML syntax) More precisely, I can have serveral XML...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
6
by: Brian Miller | last post by:
I've been constructing an ASP.Net application using the 1.1 framework, and have been using Web Matrix for development purposes. Now that my application is near completion, I wanted to see if I can...
17
by: Barret Bonden | last post by:
As an old programmer just now looking at VB.net I have a question: How does one simply open one form from another ? I don't mean how does one create a new instance of that form , but rather how...
10
by: Viken Karaguesian | last post by:
Hello everyone, Me again. Trying to learn some more :>) I hope I got the terminology right. How does a browser parse (correct term?) an HTML document. I'm sure that every browser does it a...
5
by: Allen | last post by:
I wrote many classes. In a class, there is a member variable which is declared as char szMTreeBuf. On both Windows XP and VxWorks, it cannot work. Then I try to declare the member variable as...
14
by: webEater | last post by:
I have a problem, it's not browser specific, and I don't get a solution. I have an (X)HTML document, I show you a part of it: .... <!--<div class="pad">--> <div id="eventImages"><img src=""...
32
by: Stephen Horne | last post by:
I've been using Visual C++ 2003 for some time, and recently started working on making my code compile in GCC and MinGW. I hit on lots of unexpected problems which boil down to the same template...
18
by: Stephan Beal | last post by:
Hi, all! Before i ask my question, i want to clarify that my question is not about the code i will show, but about what the C Standard says should happen. A week or so ago it occurred to me...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.