Comments (6)
Currently (because we haven't refactored yet based on the outcome of discussions on #11), this isn't possible. But with the suggested mechanism in #11, all options will actually be stored within the ngx.ctx table. This means that they are relevant to the current request only, and this is also true of sub-requests.. which have their own ngx.ctx space.
So in principle, when the new config mechanism is working (soon!), you can have different origin_location
or redis_host
options for requests and sub-requests.
Does that sound like what you need?
from ledge.
For now, yes. I'd like to help out if I can.
from ledge.
Cool, nice one. I'm in the middle of working on refactoring the config stuff, so I'll get something committed soon.. feedback will be most welcome :)
In general, this whole project is in flux right now, as you will have gathered, but it's starting to make some sense. Do feel free to send pull requests and generally request / discuss features on here. Hopefully it'll be a little less fragile in the coming weeks..
from ledge.
I've just committed a first pass of this.. So you can now do something like:
http {
init_by_lua '
rack = require "resty.rack"
ledge = require "ledge.ledge"
ledge.gset("origin_location", "/__ledge/example.com")
ledge.gset("redis_host", 192.168.1.234)
';
server {
location / {
content_by_lua '
rack.use(ledge)
rack.run()
';
}
}
}
from ledge.
I should add that ledge.gset("cache_key_spec", table)
isn't supported. Need to think about that a bit.
from ledge.
I've sent a pull request to lua-nginx-module which adds ngx.get_phase()
to the API. When this is released, we'll drop ledge.gset()
. So config parameters can be set either globally during init_by_lua
or per-location, both using the uniform ledge.set()
.
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.