Skip to content

faryon93/php-http-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

A small background HTTP fetcher for PHP utilizing goridge as a high performance IPC bridge.

The request body is refreshed every ttl seconds. When a cache entry is not access for the configured amount of time (command line flag --timeout), background fetching is disabled and the cache entry is removed.

Usage

$request = array(
    "method" => "POST",                 // method type (POST, GET allowed)
    "url" => "https://example.com",     // url                  
    "body" => http_build_query($body),  // body
    "ttl" => 12,                        // update interval in seconds
    "headers" => array(                 // request headers
        "Accept: application/json",
        "Content-Type: application/x-www-form-urlencoded",
        "User-Agent: Test"),
);

$rpc = new Goridge\RPC(new Goridge\SocketRelay("localhost", 6001));
$rpc->call("Cache.Request", json_encode($request))

About

Background fetcher/cache for HTTP responsen accessible via Goridge

Resources

Stars

Watchers

Forks

Packages

No packages published