-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for module js - High-performance JavaScript callback handler #246
Comments
There is now official (https://www.drupal.org/node/2834257) NGINX rewrite rules for the ###
### Support for https://www.drupal.org/project/js module.
###
location ~* "^/(?:[a-z]{2}(?:-[A-Za-z]{2,4})?/)?(?:js|js/.*)$" {
rewrite ^/(.*)$ /js.php?q=$1 last;
}
### Non-clean URLs (query based, only uncomment if needed).
# if ($query_string ~ "(?:^|&)q=((?:[a-z]{2}(?:-[A-Za-z]{2,4})?/)?(?:js|js/.*))") {
# rewrite ^/(.*)$ /js.php?q=$1 last;
#} It also, currently, adds instructions on how to add support for this project: ### PHP-FPM (using https://github.com/perusio/drupal-with-nginx)
###
### 1. Copy `apps/drupal/fastcgi_drupal.conf` to `apps/drupal/fastcgi_js.conf`.
### 2. Inside `fastcgi_js.conf`, rename all cases of `index.php` to `js.php`.
###
location ^~ /js.php {
tcp_nopush off;
keepalive_requests 0;
access_log off;
try_files $uri =404; ### check for existence of php file first
include apps/drupal/fastcgi_js.conf;
fastcgi_pass phpcgi;
} In hindsight, it'd be nice if this was automatically supported by this project. |
I actually went ahead and made this a little easier to implement. Existing sites (once that PR is merged) can update to the latest code and just add the following to their site's #################################################################
### Configuration for Drupal 7 sites that use the JS Callback
### Handler module: https://www.drupal.org/project/js. This
### should be above the $not_allowed_method (since the JS module
### handles these) and above the normal drupal.conf include.
#################################################################
include apps/drupal/drupal_js.conf; |
Need help to modify NGINX configuration to add support for the the module js.
This module allows to use a really light and customized Drupal bootstrap for AJAX callback.
The gain of performance is huge.
To realize that, the module doesn't use index.php form drupal, but its own js.php script that we need to insert inside Drupal root directory.
All AJAX callbacks using this module must start with directory /js/mymodule/callback-name.
Baraccuda provides this modification to their project:
http://cgit.drupalcode.org/sandbox-omega8cc-1074910/commit/?id=1d5141b
The text was updated successfully, but these errors were encountered: