Comments (4)
Not at the moment, though since Tyk acts as an upstream proxy there's nothing stopping you adding reverse proxy in front of it to cache requests once they are handled by Tyk.
The reasoning is that we don't want to re-invent tech that's already out there that handles caching very well, and caching around web applications is well established, so using varnish or memcached integrated into your own app would be more effective than having Tyk try and shoe horn it in.
Tyk records data on all requests for quota and rate limiting, so it does need to hit the database in order to fulfil its primary gate keeping functions
For speed Tyk uses Redis, which is meant to be used in high traffic environments and can hand many read/writes cleanly. It can also be load balanced and clustered, so it can scale quite easily.
Happy to hear thought s on what could be done to make cache integration easier though - there's many assumptions here that NginX is being used to plumb request routing.
Cheers,
Martin
On 18 Sep 2014, at 23:48, shopline [email protected] wrote:
Any support for cache?
Hitting the same request twice or more with a cache can really save resource/backend server load.
—
Reply to this email directly or view it on GitHub.
from tyk.
I agree that reinventing the wheel is not a good approach, but if it is possible to utilize for example varnish or maybe nginx for the caching it would be nice with some documentation on how to set that up.
We also need to utilize SSL for all API calls. I know that varnish doesn't support SSL, but I am not sure if that only applies when it is used at the frontend and not the backend?
A typical scenario (for us) would be something like:
Tyk > Cache > Resource API server > Database
I have not speed tested Tyk yet but I trust you have and that Tyks speed is not an issue. The cache would not be for speeding up Tyk but the main issue for us would be to offload the resource servers with duplicate API calls.
from tyk.
Well, it is actually recommended to run Tyk behind a web server as an upstream proxy, so the stack would look like:
NGinX > Tyk > (Cache) > Application -> DB
This should take care of the SSL issue as you could terminate the SSL connection at the NGinX end and then handle unencrypted traffic upstream afterwards, this would simplify things massively, exposing a cache to a DMZ might not be a good idea.
I'm not overly familiar with Varnish, but looking at some configuration examples configuring it as a reverse proxy is relatively simple (at least that's what these templates imply: https://github.com/mattiasgeniar/varnish-3.0-configuration-templates), caching only methods and paths that are needed, since SSL is no longer a problem (as it is dealt with by the web server, where it should be handled), you can pipe traffic via Tyk through Varnish which is reverse proxying your web app.
from tyk.
Added a naive cache (redis) middleware feature in latest merge.
from tyk.
Related Issues (20)
- [TT-5070]Wrong HTTP status code when panic happens inside Go plugin HOT 1
- [TT-11223]ERROR: Tyk PUMP not able to connect to Redis Sentinels HOT 1
- Error with middleware in one gateway while other pods are working fine HOT 1
- KV Store config not read in tyk.conf (security.certificates.upstream) HOT 4
- User not authorized when using basic authentication HOT 1
- OAS API: transformRequestMethod.toMethod expects boolean instead of string HOT 1
- Automatic retries when there are specific errors from Upstream
- How to define proxy.listen_path as exact path? HOT 4
- HTTP/2 Continuation Frame Vulnerability
- graphql playground error for federation
- Add HTTP proxy support to MDCB
- Tyk cannot validate client certificates against a certificate authority HOT 2
- Profile Raw Editor cursor placement HOT 2
- Sd
- Sd HOT 1
- Support multiple JWKS sources / one source per OIDC provider/issuer
- [TT-12318] SSE Streaming is broken HOT 3
- Stream Request getting aborted after 2 minutes
- Support exporting custom header values in opentelemetry as span attributes
- No matching KID could be found on rotated JWKS
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 tyk.