Why NGINX?
Not optimised yet... it is still on the todo list, promise!
Then the URL gets posted here
and our 16 core Server just vanished
Testing with siege
100 or more concurrent requests for 30 seconds on a list of random urls
worker_processes 3;
worker_rlimit_nofile 40000;
pcre_jit on;
events {
use epoll;
worker_connections 1024;
multiaccept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
}
server {
open_file_cache max=10000 inactive=30s;
open_file_cache_valid 2m;
open_file_cache_min_uses 2;
open_file_cache_errors on;
}
http {
fastcgi_cache_path /var/run/nginx-fastcgi-cache levels=1:2 keys_zone=TYPO3:10m inactive=2m;
fastcgi_cache_key "$scheme$request_method$host$uri$args";
fastcgi_cache_use_stale error timeout invalid_header http_500;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
}
location ~ [^/]\.php(/|$) {
set $skip_cache 0;
if ($request_method = POST) {
set $skip_cache 1;
}
if ($request_uri ~* "/typo3/|/index.php?") {
set $skip_cache 1;
}
if ($http_cookie ~* "be_typo_user|fe_typo_user") {
set $skip_cache 1;
}
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache TYPO3;
fastcgi_cache_valid 200 10s;
add_header X-FastCGI-Cache $upstream_cache_status;
}
http {
fastcgi_cache_use_stale updating error timeout invalid_header http_500;
fastcgi_cache_background_update on;
fastcgi_cache_lock on;
}
If we could just compartmentalise different parts of the Webpage based on their lifetime
<!—#include virtual="" —>
(or how webpages were made dynamic in the early 1990’s)
config.sendCacheHeaders = 1
composer require ichhabrecht/intcache
Replaces USER_INT with <!—#include virtual="" —> and uses a pageType call to render the uncached content in a separate call
Supports as well ESI (Varnish and Cloud flare) and AJAX
http {
fastcgi_ignore_headers Set-Cookie;
}
location ~ [^/]\.php(/|$) {
ssi on;
set $cachekey "$scheme$host$request_uri";
if ($args ~* "tx_intcache") {
set $cachekey "$scheme$host$uri$args";
}
fastcgi_cache_key $cachekey;
}
https://github.com/foppelfb/nginx-talk.git
Twitter: @FoppelFB
https://code711.de/
fberger@code711.de
fberger@sudhaus7.de