Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Modify Apache http headers from perl?

Reply
Thread Tools

Modify Apache http headers from perl?

 
 
Mark
Guest
Posts: n/a
 
      09-12-2003
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
 
Reply With Quote
 
 
 
 
David Efflandt
Guest
Posts: n/a
 
      09-12-2003
On Fri, 12 Sep 2003, Mark <(E-Mail Removed)> 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 http://www.de-srv.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How Can You Modify Your Message Introduction Headers? Peter Potamus the Purple Hippo Firefox 0 09-30-2009 03:41 AM
Apache Tomcat5.5 clustering problem with Apache HTTP server 2.2.4 tanmoy.b81 Java 0 02-04-2009 08:46 AM
Cannot modify cookies after HTTP headers have been sent gibble@gmail.com ASP .Net 4 05-10-2007 07:29 PM
Server cannot clear headers after HTTP headers have been sent Ian ASP .Net Security 2 03-20-2007 09:00 AM
Howto modify HTTP Headers in XML Webservice Nils ASP .Net Web Services 0 02-19-2007 11:46 AM



Advertisments