FWeinb / electron-screenshot-service

Take screenshots using electron
MIT License
141 stars 26 forks source link

Caching #34

Closed adamscybot closed 7 years ago

adamscybot commented 7 years ago

It seems the javascript assets are very aggressively cached. Is there a way to disable caching as at the moment I have to add a random query string on the end of the src of my script tag each time i want screenshots with fresh JS.

FWeinb commented 7 years ago

It looks like you can disable electrons cache by adding a partition like this.

screenshot({
  url: 'http://google.de',
  width: 1024,
  height: 768,
  partition: "in-memory" // just don't start with "persist:" here.
}).then(...)

You can have a look here for more information. (look for partition on that page)

adamscybot commented 7 years ago

Perfect thanks