-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Caching by cookie #1544
Closed
2 tasks done
krizhanovsky opened this issue
Dec 27, 2021
· 1 comment
· Fixed by #1564 or tempesta-tech/tempesta-test#206
Closed
2 tasks done
Caching by cookie #1544
krizhanovsky opened this issue
Dec 27, 2021
· 1 comment
· Fixed by #1564 or tempesta-tech/tempesta-test#206
Comments
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 10, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
that referenced
this issue
Feb 14, 2022
Fixes #1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 14, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 15, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 15, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 15, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 15, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 16, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 16, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 16, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 17, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to ttaym/tempesta
that referenced
this issue
Feb 17, 2022
Fixes tempesta-tech#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
Have updated HTTP Tables and Caching Responses wiki pages. |
ttaym
added a commit
that referenced
this issue
Feb 18, 2022
Fixes #1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
ttaym
added a commit
to tempesta-tech/tempesta-test
that referenced
this issue
Feb 21, 2022
Fixes tempesta-tech/tempesta#1544 Signed-off-by: Aleksey Mikhaylov <aym@tempesta-tech.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scope
Need to cache or no-cache responses depending on set one or several cookies, by cookie name and/or cookie name and some value prefix. Sine HTTP tables already has very similar mechanism it might sense to implement it as an extension of HTTP tables (we'll also have blocking rules for free in this case).
#530 removes Set-Cookie from the cached object, my this might break an application - now the objects are delivered to users w/o the header and the application might rely on the header. This task will provide more flexibility on web caching.
The purpose of the task is to provide functionality equal to the following Nginx configuration:
Since we don't have #496 and #732 implemented yet, we should be able to configure thus with:
Note that the new syntax rules:
cookie
$cache
is introduced.Cookie field
We already have
search_cookie()
function, which lookups for a cookie with a specified name. The function is used for user sessions, defined by cookie (this is why it's inhttp_sess.c
). Probably we need to generalize the function and/or move it to some other place (consider http.c (but it's already overloaded), http_msg.c, http_match.c), but not necessary.Wildcards should be trivially reused from the current HTTP tables logic.
Cache flag variable
We need a generic and flexible variables mechanism (see other cases in #1391 (comment) and #907), but
$cache
is essentially just a flag and we already have flags inTFW_HTTP_MSG_COMMON
(see the values inhttp.h:218
) - we should extend the flags for other similar variables and there is no sense to introduce some heavyweight generic mechanism for now (let's leave it for #907).Just check the request flag in the caching code to check whether to cache an appropriate response.
Documentation
Please update https://github.com/tempesta-tech/tempesta/wiki/Caching-Responses and https://github.com/tempesta-tech/tempesta/wiki/HTTP-tables with links to each other.
Testing
Required functional test:
"*"
handles all the stringsThe text was updated successfully, but these errors were encountered: