homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Apache Handler to convert POST url to GET url

10+ Year Member

Msg#: 4157335 posted 3:45 am on Jun 23, 2010 (gmt 0)

How do I convert POST url to GET url?

Due to heavy server load, I am trying to bypass Rails framework and read the cached html file to render for a POST request (I know all the issues with it but it is really out of my hand).

I will like to read POST data, then pick few variables out of it and make a url path to read file from the disk.

How should I do that?



WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4157335 posted 2:37 pm on Jun 24, 2010 (gmt 0)

OK< I'll have a go...

You'll likely need to rewrite all requests for which a cached version might exist to a small script.

The script should look for the cached version, and if it exists, open it, "include" or "require" it and serve it, along with a 200-OK server status (also look at adding further logic here to handle Last-Modified, If-Modified-Since, and 304 responses).

If the cached version does not exist, open, include, and serve the non-cached page, along with a 200-OK response (again, look at supporting 304 responses here). In addition, and if desired, this case should invoke the process to generate a new cached version, so that the *next* request for this resource can be served from cache.

If neither the cached nor non-cached versions exist, serve a 404-Not found response and exit.

When working on the "If-Modified-Since" logic, be aware that with the method outlined above, you will need to look at the Last-Modified date of both the cached and non-cached versions before serving the cached version, to avoid certain 'race conditions' where a second request comes in *while* the cached version is being updated from a new non-cached version. In this case, the cached version will be older than the non-cached version and should likely not be served.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved