in reply to Re^4: Perlmonks site has become far too slow
in thread Perlmonks site has become far too slow
RewriteEngine On # Match requests like /?node_id=12345 RewriteCond %{REQUEST_URI} ^/$ RewriteCond %{QUERY_STRING} ^node_id=([0-9]+)$ # Skip if the cookie header contains userpass= RewriteCond %{HTTP_COOKIE} !(^|;\s*)userpass= # Serve cached file if it exists RewriteCond %{DOCUMENT_ROOT}/cache/%1.html -f RewriteRule ^$ /cache/%1.html [L]
Then any time anonymous requests a page, save a copy of what you serve to /cache/$node_id.html, and every time someone posts/edits content under a node, call unlink("cache/$node_id.html");
Apache should be able to crank these out way faster than CGI could.
For bonus points, store the cache in ZFS with compression enabled. Maybe also minify the HTML before saving it.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: Perlmonks site has become far too slow
by LanX (Saint) on Aug 30, 2025 at 17:38 UTC | |
by LanX (Saint) on Aug 30, 2025 at 23:23 UTC | |
by LanX (Saint) on Sep 03, 2025 at 13:11 UTC | |
by choroba (Cardinal) on Aug 31, 2025 at 19:11 UTC | |
by Corion (Patriarch) on Sep 01, 2025 at 06:37 UTC | |
by Discipulus (Canon) on Sep 01, 2025 at 12:08 UTC | |
by choroba (Cardinal) on Sep 01, 2025 at 12:49 UTC | |
by LanX (Saint) on Sep 01, 2025 at 10:09 UTC | |
by choroba (Cardinal) on Sep 01, 2025 at 10:50 UTC | |
|