Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cache option #566

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

add cache option #566

wants to merge 1 commit into from

Conversation

Dong-Gao
Copy link

@Dong-Gao Dong-Gao commented Aug 6, 2020

add cache option
the default/missing cache value is false, which means it does not store response body on local disk, so no longer worry about too much disk usage; when cache is false, the webinterface is forced to disable

If you want to keep local cache, e.g the webInterface is needed, you can also set cache value to true

const options = {
  port: 8001,
  cache: false
};

const proxyServer = new AnyProxy.ProxyServer(options);

@CLAassistant
Copy link

CLAassistant commented Aug 6, 2020

CLA assistant check
All committers have signed the CLA.

if (!('cache' in config)) {
config.cache = true;
}
const recorder = config.cache ? new Recorder() : { fake: true };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

试试这种模式:

config.recorderDiskCache  ? new Recorder() : new Recorder({diskCache: false});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants