Closed (fixed)
Project:
Boost
Version:
6.x-1.18
Component:
Caching logic
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
22 Sep 2008 at 21:42 UTC
Updated:
1 Mar 2012 at 04:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Arto commentedThanks for the bug report, Alexander.
I've fixed this in 6.x-1.x-dev as of changeset [148738], by simply preventing the caching of HTTP responses other than the normal "200 OK". Hence "404 Not Found" responses will never be cached in this newest version of Boost, eliminating this issue.
I will not be backporting this to the 5.x-1.x-dev branch myself, but in case you want to do that and post the results as a patch here, I will certainly commit it. Feel free to reopen this issue should you want to proceed with the 5.x patch.
Comment #2
Arto commentedLinking to an earlier related issue for future reference: #175633: 404 Not Found response on front page
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
Alexander Ufimtsev commentedindeed, porting this patch was literally copy and paste. Thanks again, Arto. This works for me, please test:
Comment #5
mcarbone commentedd5 patch worked great on a production site. Thanks!
Comment #6
joshk commented@marco: rad!
I think this will also solve my other issue #345484
I'll test and see if I can get this committed to 5.x branch today.
Comment #7
joshk commentedWell, no such luck there. #345484: 404 hits to /files directory cached as homepage with broken form actions remains in the wild. This is still good code though. Works great. I will commit to 5.x-dev shortly.
Comment #8
joshk commentedCommitted to 5.x-dev
Comment #10
Anonymous (not verified) commentedI'm not sure if this is appropriate to rise the issue here. I think prevent Boost from caching "Page Not Found" urls might bring a Drupal-based website crashing down.
This is because it's a quite heavy load for Drupal to deal with a "Page Not Found 404" or "Rediection 301 302" request. A hacker can take advantage of this to generate some "Page Not Found" requests (around 5 requests per second) to make a Drupal-based website out of order. I think this is a quite serious problem.
I was wondering if there is anyone knows how to cope with the case that I just mentioned.
Thanks.
Ian
Comment #11
Anonymous (not verified) commentedI was thinking to modify the following code to allow Drupal to cache the page not found urls.
- if (_boost_get_content_type() == 'text/html' && _boost_get_http_status() == 200) {
+ if (_boost_get_content_type() == 'text/html' && ((_boost_get_http_status() == 200) || (_boost_get_http_status() == 404))) {
if (strlen($buffer) > 0) { // Sanity check
boost_cache_set($GLOBALS['_boost_path'], $buffer);
}
And using .htaccess to rewirte all ULRs with "/" at the end to make this kind of URLs run without the last /.
Of course, Apache will take care of the case that if there is a .html file under the path.
Not sure if this could work and any side effect?
Thanks.