Comments (4)
It may be worth considering the following new feature, available in OpenResty 1.2.1.5:
feature: added new configure directives init_by_lua and
init_by_lua_file. they can be used to pre-load Lua modules,
register true Lua global variables, and initialize the
shared-memory storage defined via lua_shared_dict, at Nginx
config-loading time. thanks drdrxp for suggesting this new
feature.
from ledge.
Could all the config be in a module that would be loaded via init_by_lua?
from ledge.
Could all the config be in a module that would be loaded via init_by_lua?
I think using init_by_lua
for loading ledge (and resty.rack) makes a lot of sense, and on initial tests does improve performance. By loading the code module globally, but placing all config into ngx.ctx
, we have the best of both worlds in terms of performance and flexibility.
This being said, if ledge.set()
acted globally (in a local table) when loaded with init_by_lua
you could feasibly load global config options only once per server reload.
I'm not sure if ledge will know what phase it is though? (perhaps that's a feature req for lua-nginx-module?). Maybe we'd need ledge.gset()
for use within init_by_lua
? Worth looking into.
from ledge.
This is looking ok for now. There will be further changes, but at least the ambiguity has been removed.
from ledge.
Related Issues (20)
- luarocks install Error: No results matching query were found. HOT 4
- binding globally error:no such event HOT 1
- Can not Customize storage_driver
- doc error:upstream_ssl_verify default value is not false HOT 1
- Can't do a conditional on HTTP_ACCEPT_LANGUAGE HOT 1
- Openresty can't start: no file '/usr/local/lib/lua/5.1/ledge.so' HOT 1
- ESI request forced HTTPS connection even if config.upstream_use_ssl is set to false HOT 2
- HTTP v2 not supported yet HOT 1
- 500 if multiple Date headers are sent HOT 1
- Feature request: Revalidation of expired items in cache
- Recursive ESI with single handler HOT 2
- Ledge is not compatible with Openresty HOT 2
- Where are released being cut? HOT 6
- Fails to run with example from README HOT 1
- If Redis is down, response is not fetched from origin
- Ledge will only connect to Redis running on localhost HOT 10
- How to decouple range (range.lua) module? HOT 2
- issues with openresty 1.19 HOT 5
- Upstream timeout leads to mixed up responses HOT 5
- stale content not being updated HOT 4
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.
from ledge.