1

To accelerate the loading process and save bandwidth I want to keep the cache between Zalenium containers

How can I share the cached folder between sessions?

(p.s I've already set up a shared mounted volume between containers)

In other words - when I open a website on one browser - I want on the next session on a different container to use that cached data.

Gal Bracha
  • 19,004
  • 11
  • 72
  • 86
  • In general, you don't want to save the cache between runs because if something "bad" gets cached, it could affect later runs. What is it specifically you want to cache? Depending on your site, you can do things like create a login cookie so that you don't have to redo the login process, etc. – JeffC Jan 14 '20 at 16:20
  • I'm using an external proxy service - which charges by the bandwidth `0.5$-25$ / GB` - I would like to save costs - as using cached sessions would lead to 1mb per test vs. non cache where it's around 20mb per test. – Gal Bracha Jan 14 '20 at 16:31
  • It looks like I can simply copy the `~/.mozilla` folder and `~/.cache` folder from one container to another and it works - I've done the process manually. Looking for a way to make this into an automated process – Gal Bracha Jan 14 '20 at 18:00
  • I don't know anything about Zalenium... can you copy the folders into a network share accessible from all containers and then just copy them down at the start of each run (test?)? – JeffC Jan 14 '20 at 18:01
  • Yes. That's what I thought can be done. I'm looking for a hook into the start of each container and also a end hook on container terminate. In a nutshall `Zalenium` creates docker containers on the spot given the `capbilities` passed to it – Gal Bracha Jan 14 '20 at 22:03
  • Do you use NUnit? If you do, there's attributes that you can use to mark a method that gets called at the start of a run, the start of a test, etc. You may be able to use that method to copy down your cache. [NUnit docs](https://github.com/nunit/docs/wiki/Attributes) – JeffC Jan 15 '20 at 01:07

0 Answers0