PHPackages                             jworkman/wordpress-fastcgi-cache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jworkman/wordpress-fastcgi-cache

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

jworkman/wordpress-fastcgi-cache
================================

Quick tool utilities to manage a fastcgi cache enabled server

1.1.3(5y ago)0435MITPHPPHP &gt;=5.5.9

Since Jan 9Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jworkman/wordpress-fastcgi-cache)[ Packagist](https://packagist.org/packages/jworkman/wordpress-fastcgi-cache)[ RSS](/packages/jworkman-wordpress-fastcgi-cache/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (5)Used By (0)

wordpress-fastcgi-cache
=======================

[](#wordpress-fastcgi-cache)

Quick tool utilities to manage a fastcgi cache enabled server

Nginx Configuration
-------------------

[](#nginx-configuration)

In order to setup Nginx to use fast cgi cache we must configure Nginx in a couple of different places. This plugin assumes that the fast cgi cache will be located in the directory `/var/cache/nginxfastcgi`

So first lets make that directory on the server:

```
mkdir -p /var/cache/nginxfastcgi

```

Also create a `global` directory in your nginx `etc` directory:

```
mkdir /etc/nginx/global

```

Make sure you set the ownership to whatever user your nginx user is running under. Run the following and replace `owner_name` with the username that nginx uses to run under:

```
chown -R owner_name:owner_name /var/cache/nginxfastcgi

```

After that lets create a file called `/etc/nginx/global/wordpress_cache.conf` and place the below code inside of it. You can change it where you like, however be cautious of the `$fastcgi_skipcache` stuff. Also make sure to update your fast cgi socket file location to where php-fpm places its socket.

```
# example FastCGI cache exception rules
set $fastcgi_skipcache 0;
if ($http_cookie ~ "users_login_cookie") {
  set $fastcgi_skipcache 1;
}

if ($request_method = POST) {
    set $fastcgi_skipcache 1;
}

if ($query_string != "") {
    set $fastcgi_skipcache 1;
}

if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml") {
    set $fastcgi_skipcache 1;
}

if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
    set $fastcgi_skipcache 1;
}

if ( $request_uri ~ "/wp/wp-login.php" ) {
  set $fastcgi_skipcache 1;
}

if ( $request_uri ~ "/wp/wp-admin" ) {
  set $fastcgi_skipcache 1;
}

# Global restrictions configuration file.
# Designed to be included in any server {} block.
location = /favicon.ico {
    log_not_found off;
    access_log off;
}

location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
}

# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
location ~ /\. {
    deny all;
}

location /admin {
    return 301 /wp/wp-admin;
}

# Deny access to any files with a .php extension in the uploads directory
# Works in sub-directory installs and also in multisite network
# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
location ~* /(?:uploads|files)/.*\.php$ {
    deny all;
}

# WordPress single blog rules.
# Designed to be included in any server {} block.

# This order might seem weird - this is attempted to match last if rules below fail.
# http://wiki.nginx.org/HttpCoreModule
location / {
    add_header 'Access-Control-Allow-Origin' '*';
    add_header 'Accept-Encoding' 'gzip';
    try_files $uri $uri/ /index.php?$args;
}

# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

# Directives to send expires headers and turn off 404 error logging.
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
       access_log off; log_not_found off; expires max;
}

# Pass all .php files onto a php-fpm/php-fcgi server.
location ~ [^/]\.php(/|$) {
    fastcgi_split_path_info ^(.+?\.php)(/.*)$;
    if (!-f $document_root$fastcgi_script_name) {
        return 404;
    }

	fastcgi_buffers 8 16k;
    fastcgi_buffer_size 32k;

    add_header X-Cache $upstream_cache_status;
    fastcgi_cache fastcgicache;
    fastcgi_cache_bypass $fastcgi_skipcache;
    fastcgi_no_cache $fastcgi_skipcache;

    # This is a robust solution for path info security issue and works with "cgi.fix_pathinfo = 1" in /etc/php.ini (default)
    fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
    fastcgi_param APP_ENV prod;
    fastcgi_read_timeout 600;
}

```

After creating your global wordpress cache configuration you will need to define your cache system in nginx by adding a file `/etc/nginx/global/cache.conf` and adding the following lines:

```
fastcgi_cache_path /var/cache/nginxfastcgi levels=1:2 keys_zone=fastcgicache:5m inactive=5m max_size=64m;
fastcgi_cache_key $scheme$request_method$host$request_uri;
# note: can also use HTTP headers to form the cache key, e.g.
fastcgi_cache_lock on;
fastcgi_cache_use_stale error timeout invalid_header updating http_500;
fastcgi_cache_valid 5m;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;

proxy_buffer_size   128k;
proxy_buffers   4 256k;
proxy_busy_buffers_size   256k;

```

And finally after that file is created you must include it in the nginx configuration by adding the following line to `/etc/nginx/nginx.conf` below `client_max_body_size`:

```
include             /etc/nginx/global/cache.conf;

```

After that you must replace your fast cgi block with the following under any wordpress site configuration:

```
include 			global/wordpress_cache.conf;

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~403 days

Total

4

Last Release

1838d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/565670ad50c2ec516cbeb1adbb0aae17f377f07755093992bd1beb0268aa9228?d=identicon)[jworkman](/maintainers/jworkman)

---

Top Contributors

[![jworkman](https://avatars.githubusercontent.com/u/915592?v=4)](https://github.com/jworkman "jworkman (7 commits)")

---

Tags

wordpressfastcgi

### Embed Badge

![Health badge](/badges/jworkman-wordpress-fastcgi-cache/health.svg)

```
[![Health](https://phpackages.com/badges/jworkman-wordpress-fastcgi-cache/health.svg)](https://phpackages.com/packages/jworkman-wordpress-fastcgi-cache)
```

###  Alternatives

[tgmpa/tgm-plugin-activation

TGM Plugin Activation is a PHP library that allows you to easily require or recommend plugins for your WordPress themes (and plugins).

1.8k222.5k13](/packages/tgmpa-tgm-plugin-activation)[aristath/kirki

Extending the WordPress customizer

1.3k73.0k4](/packages/aristath-kirki)[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.6k](/packages/afragen-git-updater)[justintadlock/hybrid-carbon

God-like post featured image script.

202.5k](/packages/justintadlock-hybrid-carbon)[typisttech/wp-admin-notices

A simplified OOP implementation of the WordPress admin notices

141.2k](/packages/typisttech-wp-admin-notices)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
