Loading ...
Sorry, an error occurred while loading the content.

Cache-Control problem

Expand Messages
  • Tom Lancaster
    Hi, I m having some problems trying to set the Cache-Control header using Apache::ASP. The only values I can get it to hold are public and private . I ve
    Message 1 of 3 , Feb 20, 2003
    • 0 Attachment
      Hi,

      I'm having some problems trying to set the Cache-Control header using
      Apache::ASP. The only values I can get it to hold are 'public' and
      private'.

      I've tried using
      $Response->{CacheControl} = 'max-age=1800,no-cache="Set-Cookie"';

      and

      $Response->AddHeader('Cache-Control',
      'max-age=1800,no-cache="Set-Cookie"');

      ... but all they produce in the headers when i telnet in are 'public'.

      I made a mod_perl handler to do the same thing using $r->header_out, and
      it worked fine.

      Is Apache::ASP munging these values somehow ? I couldn't see it doing so
      in the source. What am I missing ?

      Oh, I'm using Apache 1.3.27, Apache::ASP 2.29

      TIA,

      Tom


      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Josh Chamas
      ... This should have worked fine. I just tried a test script: #### TEST SCRUIPT {CacheControl} = max-age=1800,no-cache= Set-Cookie ; % test
      Message 2 of 3 , Feb 23, 2003
      • 0 Attachment
        Tom Lancaster wrote:
        > Hi,
        >
        > I'm having some problems trying to set the Cache-Control header using
        > Apache::ASP. The only values I can get it to hold are 'public' and
        > private'.
        >
        > I've tried using
        > $Response->{CacheControl} = 'max-age=1800,no-cache="Set-Cookie"';
        >
        > and
        >
        > $Response->AddHeader('Cache-Control',
        > 'max-age=1800,no-cache="Set-Cookie"');
        >

        This should have worked fine. I just tried a test script:

        #### TEST SCRUIPT
        <%
        $Response->{CacheControl} = 'max-age=1800,no-cache="Set-Cookie"';
        %>

        test
        #################

        and the output was:

        [job@gate job]$ lwp-request -ed http://gate:81/asp/eg/cache_control.asp
        Cache-Control: max-age=1800,no-cache="Set-Cookie"
        Connection: close
        Date: Sun, 23 Feb 2003 23:56:28 GMT
        Server: Apache/1.3.27 (Unix) PHP/4.2.3 mod_fastcgi/2.2.12 mod_perl/1.27 mod_ssl/2.8.11 OpenSSL/0.9.6g
        Content-Length: 64
        Content-Type: text/html
        Client-Date: Sun, 23 Feb 2003 23:56:28 GMT
        Client-Peer: 192.168.0.10:81
        Set-Cookie: session-id=0b3a8dc86173ab6b01d215064498ebad; path=/

        The default output for the Cache-Control header is "private"
        so I find it odd that you are getting public in your tests.

        > Is Apache::ASP munging these values somehow ? I couldn't see it doing so
        > in the source. What am I missing ?

        Apache::ASP just uses the $Response->{CacheControl} member to
        set Cache-Control header like this in Apache::ASP::Response:

        # do the Cache-Control header
        $r->header_out('Cache-Control', $self->{CacheControl});

        I am not sure what is wrong in your app. Is it possible
        that there is a "public" value being set somewhere in your
        global ASP code? Maybe in Script_OnEnd or something?

        Regards,

        Josh

        ________________________________________________________________
        Josh Chamas, Founder phone:925-552-0128
        Chamas Enterprises Inc. http://www.chamas.com
        NodeWorks Link Checking http://www.nodeworks.com


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • Tom Lancaster
        Josh, you re right - my header component was setting it to public . Doh! Thanks, Tom ... To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org For
        Message 3 of 3 , Feb 26, 2003
        • 0 Attachment
          Josh,

          you're right - my header component was setting it to 'public'. Doh!

          Thanks,

          Tom

          On Sun, 2003-02-23 at 16:01, Josh Chamas wrote:
          > Tom Lancaster wrote:
          > > Hi,
          > >
          > > I'm having some problems trying to set the Cache-Control header using
          > > Apache::ASP. The only values I can get it to hold are 'public' and
          > > private'.
          > >
          > > I've tried using
          > > $Response->{CacheControl} = 'max-age=1800,no-cache="Set-Cookie"';
          > >
          > > and
          > >
          > > $Response->AddHeader('Cache-Control',
          > > 'max-age=1800,no-cache="Set-Cookie"');
          > >
          >
          > This should have worked fine. I just tried a test script:
          >
          > #### TEST SCRUIPT
          > <%
          > $Response->{CacheControl} = 'max-age=1800,no-cache="Set-Cookie"';
          > %>
          >
          > test
          > #################
          >
          > and the output was:
          >
          > [job@gate job]$ lwp-request -ed http://gate:81/asp/eg/cache_control.asp
          > Cache-Control: max-age=1800,no-cache="Set-Cookie"
          > Connection: close
          > Date: Sun, 23 Feb 2003 23:56:28 GMT
          > Server: Apache/1.3.27 (Unix) PHP/4.2.3 mod_fastcgi/2.2.12 mod_perl/1.27 mod_ssl/2.8.11 OpenSSL/0.9.6g
          > Content-Length: 64
          > Content-Type: text/html
          > Client-Date: Sun, 23 Feb 2003 23:56:28 GMT
          > Client-Peer: 192.168.0.10:81
          > Set-Cookie: session-id=0b3a8dc86173ab6b01d215064498ebad; path=/
          >
          > The default output for the Cache-Control header is "private"
          > so I find it odd that you are getting public in your tests.
          >
          > > Is Apache::ASP munging these values somehow ? I couldn't see it doing so
          > > in the source. What am I missing ?
          >
          > Apache::ASP just uses the $Response->{CacheControl} member to
          > set Cache-Control header like this in Apache::ASP::Response:
          >
          > # do the Cache-Control header
          > $r->header_out('Cache-Control', $self->{CacheControl});
          >
          > I am not sure what is wrong in your app. Is it possible
          > that there is a "public" value being set somewhere in your
          > global ASP code? Maybe in Script_OnEnd or something?
          >
          > Regards,
          >
          > Josh
          >
          > ________________________________________________________________
          > Josh Chamas, Founder phone:925-552-0128
          > Chamas Enterprises Inc. http://www.chamas.com
          > NodeWorks Link Checking http://www.nodeworks.com


          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        Your message has been successfully submitted and would be delivered to recipients shortly.