1

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?

jmu
  • 203
  • 2
  • 10

1 Answers1

1

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

coagmano
  • 5,542
  • 1
  • 28
  • 41
  • Thank you for your suggestion. I tried the second and the third way. But none of them work for me. I keep getting "undefined" in my console. I go into the meteor folder. Then, I typed `SET METEOR_DISABLE_OPTIMISTIC_CACHING=1`. In my main.js, I used `console.log(process.env.METEOR_DISABLE_OPTIMISTIC_CACHING);` to log the result. But eventually, I got "undefined". I am not sure if there were anything wrong with my meteor installation. Do you have any idea about this? – jmu Apr 11 '18 at 22:01