Skip to content
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

Request doesn't hit same normalized query string cache #111

Open
benkajaja opened this issue Apr 13, 2021 · 0 comments
Open

Request doesn't hit same normalized query string cache #111

benkajaja opened this issue Apr 13, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@benkajaja
Copy link

I deploy a normalize-query-string on edge in order to improve cache hit ratio as mentioned in this document.
However, it seems like that different query strings (e.g., key2=val2&key1=val1, KEY2=VAL2&KEY1=VAL1) which have been normalized in same order and lowercase (i.e., key1=val1&key2=val2) would not hit the cache.

I know there are four or more edge nodes, and request would pass to one of them as shown in Fig.1.

Fig.1
differentCDN

In this situation, I could not test hit ratio properly. Thus, I modify /etc/hosts on my laptop in order to lock specific edge node. The result is shown in Fig.2. Note that, these requests are finished in 3 seconds (within maxttl=10s)

Fig.2
lockCDN

Logs of hellocdk lambda
cloudwatch

Reproduction Steps

Deploy a cloudfront(with normalize-query-string ext) + apigateway + lambda
https://github.com/benkajaja/cdk-cloudfront-plus/tree/chore/Add-demo-of-normalize-query-string/src/demo/normalize-query-string

Modify cloudfront domain name(cfdomain) in demo.sh, and then execute it.

What did you expect to happen?

Within same edge node,
Task1: Miss
Task2: Hit
Task3: Hit
Task4: Hit

What actually happened?

Miss cache with same normalized query strings

Environment

  • CDK CLI Version : 1.89.0
  • Framework Version:
  • Language (Version):

Other

@benkajaja benkajaja added the bug Something isn't working label Apr 13, 2021
@NingLu NingLu self-assigned this Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants