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

clearing cache not having effect as max-age directive is making browser not connectin to the server to check the if cache is valid #423

Open
IOR88 opened this issue May 5, 2024 · 0 comments

Comments

@IOR88
Copy link

IOR88 commented May 5, 2024

I think the end part of the code is making the browser to not refresh the cache, I saw discussions about it in the forum but not sure how we could change it, as I think this logic maybe different on per view basis ? I have one api for which I need to clear cache when other apis are triggered to refresh information, in that case I cannot pass max-age, I should pass no-cache, as other way browser is not verifying if cache is valid.

            # response.headers["Cache-Control"] = f"max-age={expire}"
            etag = f"W/{hash(encoded_ret)}"
            response.headers["ETag"] = etag
            return ret
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

No branches or pull requests

1 participant