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

Clear cache and clear cookie #1873

Open
momokang opened this issue Oct 14, 2023 · 2 comments
Open

Clear cache and clear cookie #1873

momokang opened this issue Oct 14, 2023 · 2 comments
Labels
enhancement New feature or request needs triage

Comments

@momokang
Copy link

momokang commented Oct 14, 2023

I'm running the app with pm2, but it looks like after awhile, the ram usage will be very high, I suspect it's due to cache and cookie, my current solution is close the browser and run it again every 2 hours, but it is wrong because close the browser randomly might break the transaction.

I like to request (or if there is existing function), to able to clear cache and cookie,
I think it should can be clear on puppeteer ?

I had declared puppeteer options like this

session: 'session',
puppeteerOptions: {
args: [
"--disable-web-security",
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-web-security",
"--aggressive-cache-discard",
"--disable-cache",
"--disable-application-cache",
"--disable-offline-load-stale-cache",
"--disk-cache-size=0",
"--disable-background-networking",
"--disable-default-apps",
"--disable-extensions",
"--disable-sync",
"--disable-translate",
"--hide-scrollbars",
"--metrics-recording-only",
"--mute-audio",
"--no-first-run",
"--safebrowsing-disable-auto-update",
"--ignore-certificate-errors",
"--ignore-ssl-errors",
"--ignore-certificate-errors-spki-list",
'--use-gl=egl'
],
userDataDir: './tokens/session',
executablePath: executablePath()
},

But the RAM is still going-up and increasing and it will cause user session logout, is there any solution?
Perhaps something like, wppconnection.clearCookie()
Thanks.

@momokang momokang added enhancement New feature or request needs triage labels Oct 14, 2023
@momokang
Copy link
Author

momokang commented Nov 1, 2023

Update: I tried pm2 garbage collection global.gc()
https://stackoverflow.com/questions/28522163/node-js-memory-leak-with-pm2

But unfortunately, it will reload the browser and relogin (Which is not I wanted)
Still seeking for memory leak solution.

@JoaoVitor2310
Copy link

Update: I tried pm2 garbage collection global.gc() https://stackoverflow.com/questions/28522163/node-js-memory-leak-with-pm2

But unfortunately, it will reload the browser and relogin (Which is not I wanted) Still seeking for memory leak solution.

Any new ideas? I'm going through the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

2 participants