jmu
jmu

Reputation: 203

where should I set METEOR_DISABLE_OPTIMISTIC_CACHING

I am totally new to Meteor. I am trying to run Reaction Commerce on my local machine. I found someone pointed that set METEOR_DISABLE_OPTIMISTIC_CACHING = 1 can speed up the meteor loading time. However, I don't know how to set this thing up on Window 10.

Does anyone know about this?

Upvotes: 1

Views: 198

Answers (1)

coagmano
coagmano

Reputation: 5671

METEOR_DISABLE_OPTIMISTIC_CACHING is an environment variable.

You can set it in three ways:

  1. system-wide in control panel
  2. for a specific shell by using SET METEOR_DISABLE_OPTIMISTIC_CACHING=1 in a command prompt before running meteor. Easiest to use in a .bat file
  3. in an npm script using the cross-env package

I recommend using cross-env. First meteor npm install --save cross-env

Then add a start script to package.json:

"scripts": {
  "start": "cross-env METEOR_DISABLE_OPTIMISTIC_CACHING=1 meteor run"
}

now when you run npm start it will set the environment variable just for that one running instance of meteor

Upvotes: 1

Related Questions