{"id":16315178,"url":"https://github.com/robrwo/perl-plack-app-prerender","last_synced_at":"2026-05-19T14:07:13.166Z","repository":{"id":56838320,"uuid":"303400615","full_name":"robrwo/perl-Plack-App-Prerender","owner":"robrwo","description":"A simple prerendering proxy for Plack","archived":false,"fork":false,"pushed_at":"2020-11-07T13:53:52.000Z","size":38,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T13:26:50.372Z","etag":null,"topics":["chrome","perl","plack","prerender"],"latest_commit_sha":null,"homepage":"https://metacpan.org/release/Plack-App-Prerender","language":"Perl","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/robrwo.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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":"2020-10-12T13:27:46.000Z","updated_at":"2020-11-07T13:53:54.000Z","dependencies_parsed_at":"2022-08-29T02:41:35.221Z","dependency_job_id":null,"html_url":"https://github.com/robrwo/perl-Plack-App-Prerender","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/robrwo/perl-Plack-App-Prerender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2Fperl-Plack-App-Prerender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2Fperl-Plack-App-Prerender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2Fperl-Plack-App-Prerender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2Fperl-Plack-App-Prerender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robrwo","download_url":"https://codeload.github.com/robrwo/perl-Plack-App-Prerender/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2Fperl-Plack-App-Prerender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33219434,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-19T07:54:09.561Z","status":"ssl_error","status_checked_at":"2026-05-19T07:54:08.508Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["chrome","perl","plack","prerender"],"created_at":"2024-10-10T21:56:27.116Z","updated_at":"2026-05-19T14:07:13.150Z","avatar_url":"https://github.com/robrwo.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nPlack::App::Prerender - a simple prerendering proxy for Plack\n\n# VERSION\n\nversion v0.2.1\n\n# SYNOPSIS\n\n```perl\nuse CHI;\nuse Log::Log4perl qw/ :easy /;\nuse Plack::App::Prerender;\n\nmy $cache = CHI-\u003enew(\n    driver   =\u003e 'File',\n    root_dir =\u003e '/tmp/test-chi',\n);\n\nLog::Log4perl-\u003eeasy_init($ERROR);\n\nmy $app = Plack::App::Prerender-\u003enew(\n    rewrite =\u003e \"http://www.example.com\",\n    cache   =\u003e $cache,\n    wait    =\u003e 10,\n)-\u003eto_app;\n```\n\n# DESCRIPTION\n\nThis is a PSGI application that acts as a simple prerendering proxy\nfor websites using Chrone.\n\nThis only supports GET requests, as this is intended as a proxy for\nsearch engines that do not support AJAX-generated content.\n\n# ATTRIBUTES\n\n## mech\n\nA [WWW::Mechanize::Chrome](https://metacpan.org/pod/WWW::Mechanize::Chrome) object. If omitted, a headless instance of\nChrome will be launched.\n\nIf you want to specify alternative options, you chould create your own\ninstance of WWW::Mechanize::Chrome and pass it to the constructor.\n\n## rewrite\n\nThis can either be a base URL prefix string, or a code reference that\ntakes the PSGI `REQUEST_URI` and environment hash as arguments, and\nreturns a full URL to pass to [\"mech\"](#mech).\n\nIf the code reference returns `undef`, then the request will abort\nwith an HTTP 400.\n\nIf the code reference returns an array reference, then it assumes the\nrequest is a Plack response and simply returns it.\n\nThis can be used for simple request validation.  For example,\n\n```perl\nuse Robots::Validate v0.2.0;\n\nsub validator {\n  my ($path, $env) = @_;\n\n  state $rv = Robots::Validate-\u003enew();\n\n  unless ( $rv-\u003evalidate( $env ) ) {\n      if (my $logger = $env-\u003e{'psgix.logger'}) {\n         $logger-\u003e( { level =\u003e 'warn', message =\u003e 'not a bot!' } );\n      }\n      return [ 403, [], [] ];\n  }\n\n  ...\n}\n```\n\n## cache\n\nThis is the cache handling interface. See [CHI](https://metacpan.org/pod/CHI).\n\nIf no cache is specified (v0.2.0), then the result will not be cached.\n\n## max\\_age\n\nThis is the maximum time (in seconds) to cache content.  If the page\nreturns a `Cache-Control` header with a `max-age`, then that will be\nused instead.\n\n## request\n\nThis is a hash reference (since v0.2.0) of request headers to pass\nthrough the proxy.  The keys are the request header fieldss, and the\nvalues are the headers that will be passed to the [\"rewrite\"](#rewrite) URL.\n\nValues of `1` will be a synonym for the same header, and false values\nwill mean that the header is skipped.\n\nAn array reference can be used to simply pass through a list of\nheaders unchanged.\n\nIt will default to the following headers:\n\n- `X-Forwarded-For`\n- `X-Forwarded-Host`\n- `X-Forwarded-Port`\n- `X-Forwarded-Proto`\n\nThe `User-Agent` is forwarded as `X-Forwarded-User-Agent`.\n\n## response\n\nThis is a hash reference (since v0.2.0) of request headers to return\nfrom the proxy.  The keys are the response header fields, and the\nvalues are the headers that will be returned from the proxy.\n\nValues of `1` will be a synonym for the same header, and false values\nwill mean that the header is skipped.\n\nAn array reference can be used to simply pass through a list of\nheaders unchanged.\n\nIt will default to the following headers:\n\n- `Content-Type`\n- `Expires`\n- `Last-Modified`\n\n## wait\n\nThe number of seconds to wait for new content to be loaded.\n\n# LIMITATIONS\n\nThis does not support cache invalidation or screenshot rendering.\n\nThis only does the bare minimum necessary for proxying requests. You\nmay need additional middleware for reverse proxies, logging, or\nsecurity filtering.\n\n# SEE ALSO\n\n[Plack](https://metacpan.org/pod/Plack)\n\n[WWW::Mechanize::Chrome](https://metacpan.org/pod/WWW::Mechanize::Chrome)\n\nRendertron [https://github.com/GoogleChrome/rendertron](https://github.com/GoogleChrome/rendertron)\n\n# SOURCE\n\nThe development version is on github at [https://github.com/robrwo/perl-Plack-App-Prerender](https://github.com/robrwo/perl-Plack-App-Prerender)\nand may be cloned from [git://github.com/robrwo/perl-Plack-App-Prerender.git](git://github.com/robrwo/perl-Plack-App-Prerender.git)\n\n# BUGS\n\nPlease report any bugs or feature requests on the bugtracker website\n[https://github.com/robrwo/perl-Plack-App-Prerender/issues](https://github.com/robrwo/perl-Plack-App-Prerender/issues)\n\nWhen submitting a bug or request, please include a test-file or a\npatch to an existing test-file that illustrates the bug or desired\nfeature.\n\n# AUTHOR\n\nRobert Rothenberg \u003crrwo@cpan.org\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is Copyright (c) 2020 by Robert Rothenberg.\n\nThis is free software, licensed under:\n\n```\nThe Artistic License 2.0 (GPL Compatible)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobrwo%2Fperl-plack-app-prerender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobrwo%2Fperl-plack-app-prerender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobrwo%2Fperl-plack-app-prerender/lists"}