Giter VIP home page Giter VIP logo

casper's Introduction

Casper (a friendly Spectre)

Build Status

This repo contains Casper, a caching proxy internal to Yelp. It is built with Nginx and Openresty at its core and contains some logic in Lua to fit in our ecosystem.

Important note about naming: Casper was initially baptized "Spectre" internally. It's only after the Spectre/Meltdown vulnerabilities were published that we decided to change the name to "Casper", a more friendly and less confusing name for the outside world. If you see remnants of "Spectre" in the code, that's why!

Requirements

  • docker: make sure it's installed on your system by following the instruction for your platform here.
  • make: ensure you can run make targets with your OS (on Windows, use nmake.)

Building locally

To start Casper, run

$ make dev

To make sure it's up (change the port accordingly if you change the default):

$ curl -v localhost:32927/status

For basic debugging (is it missing/hitting the cache? Am I being correctly proxied? etc), curl, and pay attention to the "Spectre-Cache-Status" header:

$ curl -o /dev/null -iv -H 'X-Source-Id: test' -H 'X-Smartstack-Destination: yelp-main.internalapi' -H 'X-Smartstack-Source: spectre.main' -H 'Host: internalapi' 'localhost:32927/category_yelp/?locale=en_US' 2>&1 | grep 'Spectre-Cache-Status'
< Spectre-Cache-Status: hit

To debug deeper it's highly recommended that you hop in the docker container in which nginx/lua are running with:

$ make inspect

It can help, to get as much information as possible, to set nginx logging to debug granularity. In nginx.conf, replace the error_log directive by:

error_log /var/log/nginx.debug.log debug;

Running Tests

To run unit tests:

$ make test

To run integration tests:

$ make itest

Contributors

Casper was built and developed internally for about a year before being opensourced. In addition to the contributors listed on Github, here is a list of people who contributed to Casper before its public life:

Contributing

We welcome contributions to Casper, but keep in mind that this is a production system run inside of Yelp's infrastructure. Please get in touch with us to discuss your feature request, bug fix or enhancement by opening a Github issue.

casper's People

Contributors

arnaudbrousseau avatar dkbala avatar drolando avatar kaisen avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.