question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cache downloaded Chromium

See original GitHub issue

We are using npm ci on our CI platform to make sure we are working on a clean install. The tests running there are executed multiple times per day for multiple projects all using puppeteer.

npm ci

Description

This command is similar to npm install, except it’s meant to be used in automated environments such as test platforms, continuous integration, and deployment – or any situation where you want to make sure you’re doing a clean install of your dependencies.

The problem is that each run downloads Chromium again even if it was downloaded before already. Which will be multiple GB per day in traffic we have to pay for 😦

It would be really helpful if you could cache Chromium in NPM cache to be used for later downloads of the same file the same way as the packages itself are cached in NPM.

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 7.0.1
  • Platform / OS version: Mac & Linux
  • URLs (if applicable): -
  • Node.js version: 10.23.2

What steps will reproduce the problem?

  1. Add puppeteer as (dev) dependency in package.json
  2. npm ci

What is the expected result?

Chromium should be installed from NPM cache if already downloaded before

What happens instead?

Chromium gets downloaded each time

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dfernandez79commented, Jun 17, 2021

An update to my last comment, if you set PUPPETEER_DOWNLOAD_PATH you don’t need to also set PUPPETEER_EXECUTABLE_PATH. By default the code here: https://github.com/puppeteer/puppeteer/blob/bba3f41286908ced8f03faf98242d4c3359a5efc/src/node/Launcher.ts#L596 means that Puppeteer will try to find the executable in the download path.

It means that solving this issue is extremely easy:

export PUPPETEER_DOWNLOAD_PATH=~/.npm/chromium

In you shell config… and that’s all 😄

Probably this should be documented in the README.

0reactions
stale[bot]commented, Jul 24, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does Chrome cache a downloaded file?
It does cache the file, though the cache is deleted very often, it is more likely your file's already deleted. · For some...
Read more >
Chrome caching downloads from flask (and how to stop it)?
Yes, chrome has a highly robust cache. When testing, you can circumvent it by pressing CTRL+F5 , which is reload with avoiding the...
Read more >
Cache viewer for Google Chrome Web browser
ChromeCacheView is a small utility that reads the cache folder of Google Chrome Web browser, and displays the list of all files currently...
Read more >
HTTP Cache
The HTTP Cache is the module that receives HTTP(S) requests and decides when and how to fetch data from the Disk Cache or...
Read more >
How to Access the Google Chrome Cache in Windows
If you're a developer and want to access this feature, select the "More Tools" option on the Chrome menu, choose "Developer Tools," locate...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found