Git Product home page Git Product logo

asset-server's People

Contributors

cantsin avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

asset-server's Issues

NGINX + lua + Hashing for asset server upload

I have found a lots of resources on this:

  1. https://github.com/openresty/lua-resty-upload
  2. https://github.com/pgaertig/nginx-big-upload
  3. http://stackoverflow.com/questions/22461341/nginx-1-5-file-upload-best-practices
  4. http://leafo.net/posts/creating_an_image_server.html
  5. http://bl.ocks.org/justincormack/948423

Anyway the basic outline is:

  1. We are going to need nginx with lua/luajit compiled in.
  2. Since we don't want to buffer the entire file in memory we are going to need a way to store it in a temp location on disk till we have a complete hash of the file then we can move it.
  3. nginx+lua supports file-upload so we can make it as trivial as curl --binary-data file.foo http://resource/uri for uploading new content/new versions :)

So what we need to do:

  1. Compile nginx with lua and maybe some of the lua framework
  2. Setup a basic file-send/share directory with the uri + hash (ie asset/game1/logic.lua/) for fetching that specific file+version
  3. Add in a hook for PUT/POST to the asset uri (PUT asset/game1/logic.lua) which will store the file in a temp loc, and generate the hash, move it into the final loc, return the hashed uri/hash.
  4. Can later have lua ping the specific game-server and be like yo you got a new version of X asset.

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.