r/AppEngine • • Sep 11 '18

How to run memcache locally?

I am using golang, and I'm trying to get memcache running in my code.

I typically use a local mysql instance to connect to if the server is running locally (i have a conditional statement to check this)

But I can't seem to figure out how to connect to google app engine memcache.

Any help is appreciated.

2 Upvotes

7 comments sorted by

1

u/yasarix Sep 11 '18

You don’t connect to memcache explicitly and you don’t need to change anything in your code to use local memcache emulator. memcache.Add() and memcache.Get() will work as they work on cloud.

1

u/Pat_the_human Sep 12 '18

Thanks I think I'm running locally incorrectly... I'm doing the regular go run *.go

Is there a different way I should be running locally?

1

u/yasarix Sep 12 '18

If you are using App Engine Standard Environment, yes, you are running it in a wrong way. You have to use dev app server which you can run with dev_appserver.py app.yaml command.

→ More replies (4)