Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

(dws) Warning Re: CGI queries without '?'

by dws (Chancellor)
on Feb 20, 2001 at 00:25 UTC ( [id://59455]=note: print w/replies, xml ) Need Help??


in reply to CGI queries without '?'

If you're writing web-based applications, (say, to tunnel some application specific protocol over HTTP), there's a really big gotcha! waiting for you if you pass parameters on the path after the CGI without also using parameters. You may not see this gotcha in development, only to discover it when your application gets out into the real world.

The gotcha arises when there's a caching proxy server in the mix between your web server and the client browser.

Caching proxy servers are getting more and more popular as corporations (and ISP) attempt to deal with increasing demands for bandwidth. If you can cache content close to where it's being demanded, it's a big win overall.

That can really screw up naive web applications.

Caching proxy servers base their decisions on whether or not to cache on a couple of (sometimes configurable) rules. (For example, the rules MS Proxy uses are described here.) One of those rules is often "are there CGI parameters?" If you pass application parameters on the path without also passing some after a ? (and without using another incantation*), the caching proxy may hang on to the web server's response and reissue it when next asked, rather than passing the request back to the web server. If the URL points to dynamic content, or if your application depends on seeing that URL to maintain state (such as a heartbeat to tell it that the client is still alive), you're hosed in a way that can be hard to debug.

*Incantations to defeat caching proxy include the use of an Expires: or appropriate Cache-control: response header.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://59455]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-03-28 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found