Closed (fixed)
Project:
Fast 404
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 May 2011 at 23:27 UTC
Updated:
24 Mar 2012 at 03:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
mikeytown2 commentedRather than hard coding for imagecache & other modules (advagg) I query the database. See the files_proxy module's files_proxy_remote() function to see how I do it. I do have special imagecache handling in files_proxy, but that's so files_proxy downloads the source file instead of all the imagecache generated files.
Comment #2
Peter Bowey commentedYou would 'recommend' [fast404] module over the method outlined in the advagg 'readme'?
eg:
I am still 'in-study' with the various methods - particularly in reference to Nginx!
Current nginx method handling (sample):
similar logic applies to nginx /advagg handling...
Comment #3
mikeytown2 commentedThe settings.php method (2bits article) is about as fast as one can get (at the php level) without hacking core. A module is obviously more portable, and it could be more robust. The algorithm I have in the files proxy module is generic; no need to hardcode for imagecache or advagg or the next module that plays with the files directory. I'm here to point this out to soyarma when ever he sees this issue; there is a better way then having to always patch this module to take into account other modules.
I haven't tried out this module so I can't officially comment on it.
Comment #4
Peter Bowey commentedThanks Mike,
Having studied http://drupal.org/files/issues/404.diff (patch that I don't think made it to D7), and looking at how nginx (in place of using apache) can handle the need for a selective [fast 404], I submit that PHP methods are not necessary for handling static assets with drupal 'handled' 404's - be it imagecache or advagg.
I am sure you accept nginx is not a Drupal module (I refer to #3)?
Testing Mode: Seems to me that advagg refuses to validate fast404's for anything but Drupal methods.
In testing this advagg method, I find if I send 404's to Drupal that advagg expects the issue - but if I use nginx [front-end webserver] to selectively fast 404 - as per the code logic in
that advagg reports
Hence, I could be forced to hack my D6 core with http://drupal.org/files/issues/404.diff.
See http://drupal.org/node/76824
and
http://drupal.org/node/76824#comment-4050706
Comment #5
mikeytown2 commentedadvagg tests to see if a call to the sites/default/files/advagg_css/ dir will get through to the page callback for that path (see advagg_menu()). If it doesn't then there is something up-stream preventing it from happening and you won't [mafia voice]get the 404 protection for CSS/JS aggregated files that advagg offers[/mafia voice]. What prevents it from hitting the page callback can be nearly anything; server configuration, settings.php tricks, Drupal issue patches, modules, or something else. Point is, just about every configuration has imagecache white listed, advagg showed up late into the game so it has not been taken into account. In order to prevent the next module that uses the files directory as hook_menu item from having issues, I've come up with a generic way to handle this; code is in the files_proxy module. This implies a Drupal solution for this issue. A server configuration (apache/nginx) solution will always need to chase any new hook_menu items that work in the files directory; but it will be a lot faster because it doesn't involve php.
The modules I'm talking about in #3 referrer to Drupal modules :)
Comment #6
Peter Bowey commentedThanks Mike,
OK, so I need to look / study at the suggested http://drupal.org/project/files_proxy module before I commit 'code'. 'Secrets ' within the D6 'kitten'.....modules...(files_proxy).
Related part of the 'files_proxy' appears to be this:
Seems to me, at a glance, that we have a 'mixed collection' of 'proposed' D6 'fast404' methods.
Need to think and compare....
Comment #7
Peter Bowey commentedRef #5
Thanks Mike, when I did apply the full Drupal method you outlined for 404's. I got slow and skewered response times for most static assets pulled via advagg's aggregation through a CDN. The given Drupal 404 method certainly made the advagg 'report' status happy - but real life benchmarks indicated I had 40% slower response to static assets.
I went back to do handling this the previous Nginx way (fast selected 404's that Drupal only will only ever see for for 2 chosen locations -> imagecache + advagg + more as required). Benchmarking testing indicates that the 'lost' 40% performance is restored. Yet, 'poor' advagg complains like a Apache piglet - about my setup not being so 'cool'.
So after days spent on code + code for this aggregation testing, I am about to hack out (grin) all advagg's 'report' reasoning on 404 drupal handling. I think it was meant for Apache logic. For despite all the D6 report 'complaints' issued by advagg reasoning - it darn works fast.
Have you thought about some serious Nginx compat?
Comment #8
soyarma commentedI'll add in support for advagg and perhaps add a variable to set allowed paths more dynamically.
Fast_404 can't check the db, because in some configs it fires before the db connection is made.
Comment #9
alladdin commentedHow about support of advagg by fast 404 module? Still not implemented?
These 2 modules are great for high load sites.
Comment #10
mikeytown2 commentedComment #11
mikeytown2 commentedTaking the same code used for imagecache, here is a patch against the master branch for advagg; patch also takes care of some white space issues. Code that's been added in fast_404_ext_check() in fast_404.inc.
Comment #12
Renee S commentedIs that last bracket supposed to be there? :)
Comment #13
mikeytown2 commented@Reinette
Thanks for the heads up!
Comment #14
soyarma commentedWill the same fix work against advagg in D7?
Comment #15
mikeytown2 commentedYes it will, but there is no D7 version of AdvAgg currently #1171546: AdvAgg - D7 Port/Re-write
Comment #16
mikeytown2 commentedComment #17
Renee S commentedThe patch in #13 worked for me. Thanks :)
Comment #18
mikeytown2 commentedComment #19
soyarma commentedI've committed this to the dev branch, going to get a few other things in there as well and cut 1.4
Comment #20
soyarma commented