Memcached

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. You can easily add it to your Lando app by adding an entry to the services key in your app's .lando.yml.

Supported versions

Example

# Memcached example
name: memcached

#
# You need to run `lando npm install` before you run `lando start` for this
# example to work
#

# Give me http://memcache.lndo.site
proxy:
  appserver:
    - memcached.lndo.site

# Spin up a basic nodes server with memcached backend
services:

  # Spin up a memcache container called "cache"
  # NOTE: "cache" is arbitrary, you could just as well call this "theboss" or "eljefe"
  cache:

    # Use version 1.4 of memcached
    type: memcached:1.4

    # Optionally specify the size of the memcached store, defaults to 64
    mem: 128

    # Optionally allow access to the cache at localhost:11222
    # You will need to make sure port 11222 is open on your machine
    #
    # You can also set `portforward: true` to have Lando dynamically assign
    # a port. Unlike specifying an actual port setting this to true will give you
    # a different port every time you restart your app
    portforward: 11222

  # Spin up services to run a basic node server
  appserver:
    type: node:6.10
    command: npm start
    # run:
    #  - "cd $LANDO_MOUNT & npm install"

# Add some nice command routing
tooling:
  npm:
    service: appserver_cli
  node:
    service: appserver_cli

You will need to rebuild your app with lando rebuild to apply the changes to this file. You can check out the full code for this example over here.

Getting information

You can get connection and credential information about your memcached instance by running lando info from inside your app.

# Navigate to the app
cd /path/to/app

# Get info (app needs to be running to get this)
lando info

{
  "cache": {
    "type": "memcached",
    "version": "1.4",
    "internal_connection": {
      "host": "cache",
      "port": 11211
    },
    "external_connection": {
      "host": "localhost",
      "port": 11222
    }
  },
  "appserver": {
    "type": "node",
    "version": "6.10",
    "urls": [
      "http://localhost:32796",
      "http://memcache.lndo.site"
    ]
  }
}

results matching ""

    No results matching ""