{"id":13725103,"url":"https://github.com/jlengstorf/netlify-plugin-gatsby-cache","last_synced_at":"2025-05-07T19:32:47.270Z","repository":{"id":49561920,"uuid":"221823593","full_name":"jlengstorf/netlify-plugin-gatsby-cache","owner":"jlengstorf","description":null,"archived":true,"fork":false,"pushed_at":"2021-06-14T14:54:52.000Z","size":40,"stargazers_count":185,"open_issues_count":7,"forks_count":19,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-03T06:40:27.391Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/jlengstorf.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":"2019-11-15T02:02:39.000Z","updated_at":"2024-04-30T19:53:24.000Z","dependencies_parsed_at":"2022-08-20T07:01:32.244Z","dependency_job_id":null,"html_url":"https://github.com/jlengstorf/netlify-plugin-gatsby-cache","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlengstorf%2Fnetlify-plugin-gatsby-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlengstorf%2Fnetlify-plugin-gatsby-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlengstorf%2Fnetlify-plugin-gatsby-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jlengstorf%2Fnetlify-plugin-gatsby-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jlengstorf","download_url":"https://codeload.github.com/jlengstorf/netlify-plugin-gatsby-cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252943898,"owners_count":21829336,"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":"2024-08-03T01:02:13.059Z","updated_at":"2025-05-07T19:32:46.989Z","avatar_url":"https://github.com/jlengstorf.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Netlify Build Plugin: Persist the Gatsby Cache Between Builds\n\nPersist the Gatsby cache between Netlify builds for huge build speed improvements! ⚡️\n\n\u003e **Note:** The functionality in this plugin is now available in the [Essential Gatsby build plugin](https://github.com/netlify/netlify-plugin-gatsby). Check out Essential Gatsby for additional framework-specific functionality on Netlify, including Gatsby Functions. If you choose to install it, you should remove this plugin first.\n\n## Usage\n\nCurrently, there are **two ways to install this plugin on your application**: \n\n### Installing from Netlify UI\n\n#### [One-click install to add this to your Gatsby site](http://app.netlify.com/plugins/netlify-plugin-gatsby-cache/install?utm_source=github\u0026utm_medium=gatsby-cache-bp-jl\u0026utm_campaign=devex)\n\n### Installing from your project's code\n\nYou can also install it manually using `netlify.toml`. If you want to know more about file-based configuration on Netlify, click [here](https://docs.netlify.com/configure-builds/file-based-configuration/).\n\nAdd the following lines to your project's `netlify.toml` file:\n\n```toml\n[build]\n  publish = \"public\"\n\n[[plugins]]\n  package = \"netlify-plugin-gatsby-cache\"\n```\n\n\u003e Note: The `[[plugins]]` line is required for each plugin, even if you have other plugins in your `netlify.toml` file already.\n\n## How does it work?\n\nThis plugin determines the location of your `.cache` folder by looking at the `publish` folder configured for Netlify deployment. This means that if your Gatsby site successfully deploys, it will be cached as well with no config required! 🎉\n\n## How much of a difference does this plugin make in build times?\n\nEach Gatsby site is different, so build times vary widely between them, but one common slowdown in Gatsby builds is processing and transforming images. Gatsby is smart enough to check if these transformations have already been done and skip them, but in order to get that benefit in a build pipeline (e.g. Netlify) the `public` and `.cache` directories need to be preserved between builds. That’s what this plugin does!\n\n|                                                            | No Cache                                                                                                | Cache                                                                                                   | Savings |\n|------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|---------|\n| * 231 GraphQL queries\u003cbr\u003e* 1,871 images\u003cbr\u003e* 224 pages     | 293207ms ([build log](https://app.netlify.com/sites/lengstorf/deploys/5dceed27d58a580008daaccc))        | 72835ms ([build log](https://app.netlify.com/sites/lengstorf/deploys/5dcef2463da4810008d48aaa))         | 75%     |\n| * 5 GraphQL queries\u003cbr\u003e* No image processing\u003cbr\u003e* 32 pages | 22072ms ([build log](https://app.netlify.com/sites/build-plugin-test/deploys/5dceed49e746a200091c76fe)) | 15543ms ([build log](https://app.netlify.com/sites/build-plugin-test/deploys/5dceedbfad95d0000bcd46d1)) | 30%     |\n\ntl;dr: Repeat builds with lots of images will be _much_ faster. With few or no images, the difference will be there, but it won’t be as pronounced.\n\n## Want to learn how to create your own Netlify Build Plugins?\n\nCheck out [Sarah Drasner’s excellent tutorial](https://www.netlify.com/blog/2019/10/16/creating-and-using-your-first-netlify-build-plugin/?utm_source=github\u0026utm_medium=netlify-plugin-gatsby-cache-jl\u0026utm_campaign=devex)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlengstorf%2Fnetlify-plugin-gatsby-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjlengstorf%2Fnetlify-plugin-gatsby-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjlengstorf%2Fnetlify-plugin-gatsby-cache/lists"}