Does PHP do this differently?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill H

    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&somerandom number

    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
  • Jerry Stuckle

    #2
    Re: Does PHP do this differently?

    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&somerandom number
    >
    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.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Erwin Moller

      #3
      Re: Does PHP do this differently?

      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&somerandom number
      >
      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 Webdevelopertas kbar 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

      Comment

      • Gordon

        #4
        Re: Does PHP do this differently?

        On Oct 31, 1:17 am, Bill H <b...@ts1000.us 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&somerandom number
        >
        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.

        Comment

        • C. (http://symcbean.blogspot.com/)

          #5
          Re: Does PHP do this differently?

          On 31 Oct, 01:17, Bill H <b...@ts1000.us 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&somerandom number
          >
          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.

          Comment

          • Bill H

            #6
            Re: Does PHP do this differently?

            On Oct 31, 4:56 am, Gordon <gordon.mc...@n tlworld.comwrot e:
            On Oct 31, 1:17 am, Bill H <b...@ts1000.us 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&somerandom number
            >
            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

            Comment

            • C. (http://symcbean.blogspot.com/)

              #7
              Re: Does PHP do this differently?

              On 31 Oct, 15:08, Bill H <b...@ts1000.us wrote:
              On Oct 31, 4:56 am, Gordon <gordon.mc...@n tlworld.comwrot e:
              >
              >
              >
              On Oct 31, 1:17 am, Bill H <b...@ts1000.us 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&somerandom number
              >
              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.

              Comment

              Working...