{"id":24082175,"url":"https://github.com/levidurfee/nginx-cache-hit-parser","last_synced_at":"2025-06-14T22:09:12.818Z","repository":{"id":100064385,"uuid":"48661057","full_name":"levidurfee/nginx-cache-hit-parser","owner":"levidurfee","description":"Parse nginx FastCGI cache hit log file","archived":false,"fork":false,"pushed_at":"2015-12-27T22:00:44.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T00:50:18.614Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/levidurfee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-27T21:25:30.000Z","updated_at":"2015-12-27T21:48:23.000Z","dependencies_parsed_at":"2023-03-13T15:40:06.003Z","dependency_job_id":null,"html_url":"https://github.com/levidurfee/nginx-cache-hit-parser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/levidurfee/nginx-cache-hit-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levidurfee%2Fnginx-cache-hit-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levidurfee%2Fnginx-cache-hit-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levidurfee%2Fnginx-cache-hit-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levidurfee%2Fnginx-cache-hit-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/levidurfee","download_url":"https://codeload.github.com/levidurfee/nginx-cache-hit-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levidurfee%2Fnginx-cache-hit-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259890446,"owners_count":22927373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-09T23:45:43.438Z","updated_at":"2025-06-14T22:09:12.791Z","avatar_url":"https://github.com/levidurfee.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nginx-cache-hit-parser\n\n[![Build Status](https://travis-ci.org/levidurfee/nginx-cache-hit-parser.svg?branch=master)](https://travis-ci.org/levidurfee/nginx-cache-hit-parser)\n[![build v0.1.0](https://img.shields.io/badge/build-0.1.0-orange.svg?style=flat)]()\n\nParse a nginx FastCGI cache hit log file.\n\n## nginx config\n\nThis isn't verbatim - i assume you know what you're doing.\n\n```nginx\nlog_format cache '$request_method $uri $sent_http_x_cache $bytes_sent $request_time';\n\nfastcgi_cache_key \"$scheme$request_method$host$request_uri\";\nfastcgi_cache_path /tmp/nginx levels=1:2 keys_zone=website:100m inactive=60m;\n\naccess_log /var/log/nginx/website.cache.txt cache buffer=128k;\n\nadd_header X-Cache $upstream_cache_status;\n\nlocation ~ \\.php$ {\n\tfastcgi_cache website;\n\tfastcgi_cache_valid 200 60m;\n\tfastcgi_cache_methods GET HEAD; # Only GET and HEAD methods apply\n\n\t#normal php stuff\n\tfastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;\n\tfastcgi_index index.php;\n\tfastcgi_param SCRIPT_FILENAME /var/www/website$fastcgi_script_name;\n\tinclude fastcgi_params; \n}\n```\n\n## PHP usage example\n\n```php\n\u003c?php\ninclude('src' . DIRECTORY_SEPARATOR . 'fcgiCacheAnalyze.php');\necho \"Website\\n\";\n$c = new levidurfee\\fcgiCacheAnalyze('sample' . DIRECTORY_SEPARATOR . 'website.cache.txt');\n$c-\u003eanalyze();\n```\n\n## sample output\n\n```bash\nWebsite\n| Page                 | HITS  | MISS  | EXPIR | TIME  | RATIO\n| /index.php           | 55    | 18    | 3     | 0.005 | 72.36\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevidurfee%2Fnginx-cache-hit-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevidurfee%2Fnginx-cache-hit-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevidurfee%2Fnginx-cache-hit-parser/lists"}