Modify Apache http headers from perl?

Ask a Question related to PERL Miscellaneous, Design and Development.

  1. #1

    Default Modify Apache http headers from perl?

    Hi,

    In order to stop certain documents from caching I would like to modify
    the http headers generated by the server. I have tried the usual meta
    tag solution and a variety of other suggestiongs but find that whilst
    they may work in one browser they fail in others, and I have been told
    that modifying the server http header is the only reliable method.

    Unfortunately I am on a shared hosting plan with no telnet access so
    the only way I might be able ot modify the server parameters is
    through perl. There are only a few documents that I do not want to be
    cached and it would be handy if I could tell the script generating the
    document to change the header to 'no cache', deliver the document and
    then change it back to a normal header.

    Does anyone know if this is possible in perl and which commands,
    modules, etc. I should be looking at?

    Many thanks for your time and consideration.

    Mark
    Mark Guest

  2. Similar Questions and Discussions

    1. Http headers...
      Hallo, Can't get reed fo http response headers Thow I used response.ClearHeaders wich MSDN say's it should clear all http headers I'm on VS 2005...
    2. http headers with CGI.pm and mod_perl (bug?)
      I have a question about printing http headers with CGI.pm running on an Apache server with mod_perl. What happens if I need to change the http...
    3. http request headers
      I have a proxy which might delete/insert http request headers. I need a way to list the http request headers. How can i do it with perl. TIA,
    4. HTTP Headers
      On 2 Jul 2003 17:51:17 -0700, Jeff Mott <mjeff1@twcny.rr.com> wrote: First of all, Perl does not send HTTP requests. I will assume that you mean...
    5. Getting all http headers
      Hi, I'm just starting out on ASP.NET, although I'm not new to programming. I'm in a crunch and have been all over the documentation and MSDN and...
  3. #2

    Default Re: Modify Apache http headers from perl?

    On Fri, 12 Sep 2003, Mark <REMOVEXtwoheadsX@tiscaliX.co.uk> wrote:
    > In order to stop certain documents from caching I would like to modify
    > the http headers generated by the server. I have tried the usual meta
    > tag solution and a variety of other suggestiongs but find that whilst
    > they may work in one browser they fail in others, and I have been told
    > that modifying the server http header is the only reliable method.
    >
    > Unfortunately I am on a shared hosting plan with no telnet access so
    > the only way I might be able ot modify the server parameters is
    > through perl. There are only a few documents that I do not want to be
    > cached and it would be handy if I could tell the script generating the
    > document to change the header to 'no cache', deliver the document and
    > then change it back to a normal header.
    >
    > Does anyone know if this is possible in perl and which commands,
    > modules, etc. I should be looking at?
    If using CGI.pm, you could put special headers within the header(). But
    if you print the headers yourself, there is nothing Perl specific about
    it.

    HTTP headers are one per line, with the last header separated from content
    by a blank line. So when you print Content-type and any other reply
    headers, just make sure you do NOT have any blank lines (or double
    newline) until the end of the LAST header. No need to change anything
    back either, HTTP is one request, and one reply. But if a single script
    handles multiple types of requests for cached and non-cached output,
    determine which before printing any headers.

    --
    David Efflandt - All spam ignored [url]http://www.de-srv.com/[/url]
    David Efflandt Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139