asset-server's People
asset-server's Issues
NGINX + lua + Hashing for asset server upload
I have found a lots of resources on this:
- https://github.com/openresty/lua-resty-upload
- https://github.com/pgaertig/nginx-big-upload
- http://stackoverflow.com/questions/22461341/nginx-1-5-file-upload-best-practices
- http://leafo.net/posts/creating_an_image_server.html
- http://bl.ocks.org/justincormack/948423
Anyway the basic outline is:
- We are going to need nginx with lua/luajit compiled in.
- 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.
- 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:
- Compile nginx with lua and maybe some of the lua framework
- Setup a basic file-send/share directory with the uri + hash (ie asset/game1/logic.lua/) for fetching that specific file+version
- 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.
- Can later have lua ping the specific game-server and be like yo you got a new version of X asset.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.