Skip to content

Conversation

saurabh-saraswat
Copy link
Contributor

Updated the version for CRD. Updated tests to avoid failure due to late notification from Kubernetes and made one replica of app used for testing of caching functionality

spec:
containers:
- name: cache-test
image: localhost:5000/caching-app
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is defined yet?

@shukitchan
Copy link
Contributor

Actually I think the real problem is that the original design of the connect_redis.lua lua script is not taking the cache into consideration.

In this case, the same incoming URL will have equal opportunity to route to one of the 2 pods. And if the first response is to be cached, subsequent requests should be serving from cache and should not consult with the routing decision again.

I think we can call ts.http.set_cache_url inside the lua script to fix this problem.
See the description of the call here - https://docs.trafficserver.apache.org/en/latest/admin-guide/plugins/lua.en.html#ts-http-set-cache-url

Basically in do_global_read_request function of connect_redis.lua, at the beginning we can call ts.client_request.get_pristine_url to retrieve the url and then call ts.http.set_cache_url at the very end of the function to properly set the cache key to the incoming URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants