Results 1 to 8 of 8

Thread: FastCGI_Cache with Apache-Nginx

  1. #1
    Join Date
    Feb 2007
    Posts
    214

    FastCGI_Cache with Apache-Nginx

    Hi,

    is it possible to use FastCGI_Cache when using Nginx-Apache (proxied)? I got contradictory answers so far.
    According to an article here https://www.ryadel.com/en/cache-webs...tos-7-php-fpm/

    "FastCGI-Cache is currently considered the most efficient way to implement a dynamic cache mechanism in front of our web server with Nginx: that web server can be Nginx itself or another web server that Nginx will “proxy” by catching all the incoming requests, routing them to the upstream PHP-FPM server, get the resulting HTTP responses and return them to the caller."

    .. it should be possible, as Nginx - even as proxy - forwards the requests itself to PHP-FPM.
    Can anybody confirm that?

    Thank you!
    Johannes

  2. #2
    Join Date
    Feb 2007
    Posts
    214
    Ok i got it. Technically its possible, answer from nginx team: "it’s possible to access php-fpm from the reverse proxy and use fastcgi_cache there"
    .. but it makes no sense if using apache-nginx combination for compatibility with .htaccess, as with direct forwarding requests from nginx to php-fpm, this feature would be lost and so it would be no difference than using pure nginx.
    Problem cleared.
    Johannes

  3. #3
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,355
    Hello Johannes,

    You can still use proxy cache with nginx+apache+php
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

  4. #4
    Join Date
    Dec 2008
    Posts
    292
    and how it's done?
    I didn't see any guide for this subject in DA

  5. #5
    Join Date
    Feb 2007
    Posts
    214
    Quote Originally Posted by nservices View Post
    and how it's done?
    Dont know, I switched from NGinx to Litespeed shortly after this thread, and never regret it.
    Johannes

  6. #6
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,355
    Quote Originally Posted by nservices View Post
    and how it's done?
    I didn't see any guide for this subject in DA

    There is no specific guide for Directadmin, as if you are going to use Proxy or FastCGI Cache with NGINX, all the configurations are the same.

    1. Considers a system of templates in Directadmin. So you need to modify templates and add your directives for caching to start working.

    For example: https://www.nginx.com/blog/benefits-...caching-nginx/

    2. You will work with the default server location / only.

    3. Then add nginx_proxy_buffering=1 to directamin.conf

    See: https://www.directadmin.com/features.php?id=1643 and https://help.poralix.com/articles/ng...ctadmin-server
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

  7. #7
    Join Date
    Mar 2013
    Posts
    195
    whith nginx_proxy_buffering=1 you will have slower response , right?
    ShivaHost.com
    Official DirectAdmin WebHosting accepting PayPal , BitCoin , Ripple , WebMoney and PerfectMoney

  8. #8
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,355
    The best way to learn it is to give it a try

    Depending on what you are going to cache and for how long.... how much does it matter that it will take a page to load 10 seconds for the first time, if then it will be delivered from a cache within 1 second? Did you hear about cache warming up? If cache has been warmed up before that, then it will be directly returned, so it would be much faster response.

    If there are pages that you don't need to cache, then you might consider to add new locations into ngnx with disabled proxy buffering.

    If you hesitate to add new custom location into nginx, then you might consider adding Varnish between nginx and apache, and try your luck with Varnish.
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •