Hi there,
I've setup a PHP installation which proxies requests from the browser
to a Sinatra application, hidden behind Rack::Cache.
The problem I'm encountering is when I use query parameters on the
requested URL.
The cache correctly sends a 304 as expected, but the log says 'miss'.
This only seems to happen when the original requested URL contains a
querystring.
Here's my PHP code:
$url = "
http://example.org/sinatra/template.sass";
$method = 'HTTP_METH_'.$_SERVER['REQUEST_METHOD'];
$request = new HttpRequest($url, constant($method));
$request_headers = apache_request_headers();
// Remove Host header so as not to confuse Sinatra
unset($request_headers['Host']);
$request->setHeaders($request_headers);
if(!empty($_GET)) $request->setQueryData($_GET);
$request->setRawPostData(http_get_request_body());
$response_message = $request->send();
$response_message->send();
I've tried to pass as much info on to Rack::Cache as possible. The
Host header had to be removed.
Regards,
Marlin Forbes