homepage Welcome to WebmasterWorld Guest from 54.205.205.47
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
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
rajatgarg




msg:4157337
 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?

 

jdMorgan




msg:4158425
 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.

Jim

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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved