Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Add commandline switch to disable Electron disk cache for HTTP requests. #177

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cli/src/athenapdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ athena
.option("--ignore-certificate-errors", "ignores certificate errors")
.option("--ignore-gpu-blacklist", "Enables GPU in Docker environment")
.option("--wait-for-status", "Wait until window.status === WINDOW_STATUS (default: wait for page to load)")

.arguments("<URI> [output]")
.action((uri, output) => {
uriArg = uri;
Expand Down Expand Up @@ -130,8 +131,10 @@ if (process.platform === "linux") {
// Add custom headers if specified
var extraHeaders = athena.httpHeader;

// Toggle cache headers
if (!athena.cache) {
// Disable disk cache
app.commandLine.appendSwitch("disable-http-cache");
// Toggle cache headers
extraHeaders.push("pragma: no-cache");
}
const loadOpts = {
Expand Down