{"id":17470797,"url":"https://github.com/funliday/pppr","last_synced_at":"2025-08-21T00:30:38.847Z","repository":{"id":40706413,"uuid":"265211952","full_name":"funliday/pppr","owner":"funliday","description":"pppr is a prerender service","archived":false,"fork":false,"pushed_at":"2024-10-15T04:34:00.000Z","size":1037,"stargazers_count":24,"open_issues_count":7,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T10:54:34.329Z","etag":null,"topics":["expressjs","funliday","prerender","puppeteer"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funliday.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-19T10:06:05.000Z","updated_at":"2024-10-15T04:33:57.000Z","dependencies_parsed_at":"2024-10-26T19:01:13.607Z","dependency_job_id":null,"html_url":"https://github.com/funliday/pppr","commit_stats":{"total_commits":173,"total_committers":2,"mean_commits":86.5,"dds":"0.011560693641618491","last_synced_commit":"1f9a5b5e16535c07d5a33aa97fae50c911236a01"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funliday%2Fpppr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funliday%2Fpppr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funliday%2Fpppr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funliday%2Fpppr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funliday","download_url":"https://codeload.github.com/funliday/pppr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230471175,"owners_count":18231193,"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":["expressjs","funliday","prerender","puppeteer"],"created_at":"2024-10-18T16:10:23.922Z","updated_at":"2024-12-19T17:08:50.140Z","avatar_url":"https://github.com/funliday.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\u003cimg width=\"100\" src=\"https://raw.githubusercontent.com/funliday/pppr/master/assets/logo.png\" alt=\"pppr logo\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/pppr\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/pppr\" alt=\"pppr version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/pppr\"\u003e\u003cimg src=\"https://img.shields.io/npm/dw/pppr\" alt=\"pppr downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/pppr\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/pppr\" alt=\"pppr license\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# pppr\n\npppr is a zero-configuration prerender service. If you develop a web via client-side rendering (such as Vue, Angular, React...), you can integrate Nginx (or other reverse proxy) and pppr for search engine crawler (such as googlebot, bingbot...) and social network (such as Facebook, Twitter...) to render complete HTML.\n\n## Usage\n\n```js\nconst pppr = require('pppr');\n\napp.use(pppr());\n```\n\n## Installation\n\n```sh\nnpm i pppr\n```\n\n## Configuration\n\n### Nginx\n\n[Configuration](https://gist.github.com/thoop/8165802)\n\n### Cache (default is turn on)\n\n```js\napp.use(pppr());\n\n// equals to\n\napp.use(pppr({\n  cache: true\n}));\n```\n\nIf you want to turn off cache, you can do below configuration.\n\n```js\napp.use(pppr({\n  cache: false\n}));\n```\n\nIf you want to modify cache parameter, you can do below configuration.\n\n```js\napp.use(pppr({\n  cache: {\n    max: 50, // LRU cache entry max count (default is 50)\n    ttl: 300000 // LRU cache entry ttl (milliseconds, default is 300000)\n  }\n}));\n```\n\n### Retry times (default is 5)\n\nIf it renders occur timeout, you can retry render again.\n\n```js\napp.use(pppr({\n  retryTimes: 5\n}));\n```\n\n### Endpoint (default is /render)\n\nIf endpoint conflicts, you can change it.\n\n```js\napp.use(pppr({\n  endpoint: '/render'\n}));\n```\n\n### Callback\n\nIf you want to do something before/after render, you can do below configuration.\n\n```js\napp.use(pppr({\n  beforeRender: (userAgent, url) =\u003e {\n    // do something\n  },\n  afterRender: (userAgent, url, content) =\u003e {\n    // do something\n  }\n}))\n```\n\n## How-to\n\n![server side rendering](https://user-images.githubusercontent.com/795839/82450244-0b86f580-9adf-11ea-9585-3b0224aae0de.jpg)\n\nWhen Nginx received a request, it will check it is crawler or not. If it is crawler, it will forward to prerender service (such as pppr). Otherwise it will forward to web server.\n\n## Lyrics\n\nI have a page, I want to prerender it.\n\nAh, pppr.\n\n## Inspired from\n\n[prerender/prerender](https://github.com/prerender/prerender)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunliday%2Fpppr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunliday%2Fpppr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunliday%2Fpppr/lists"}