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

menu-ci.py checks for If-Modified-Since, rather than If-None-Match #399

Closed
schildbach opened this issue Dec 12, 2024 · 1 comment
Closed

Comments

@schildbach
Copy link
Contributor

While investigating into #398 I discovered this check:

        def cache_sensible(self, url: str):
                """Check whether it ever returns 304s. Yeah sure, this is a race. I
                don't care for a test that runs a few times a week at most. With
                Giggity's better caching (ETag support) I should improve/delete this."""
                if url not in self.hcache:
                        return None
                if "last-modified" in self.hcache[url]:
                        ims = self.hcache[url]["last-modified"]
                else:
                        ims = email.utils.formatdate(self.hcache[url]["_ts"], localtime=False, usegmt=True)
                headers = {"If-Modified-Since": ims}
                # GET not HEAD because the CCC webserver is fucking retarded.
                u = self.o.request(
                        "GET", url, headers=headers, redirect=False, preload_content=False)
                return u.status == 304

If the comment is true and Giggity itself supports If-None-Match then indeed I think this check should be rewritten (or disabled).

@Wilm0r
Copy link
Owner

Wilm0r commented Dec 14, 2024

Yep, added to the CI now. I forgot why I didn't do that right away other than giving people some time to update.

The check dates back to conference WiFi being pretty bad, which shouldn't be as big a problem anymore now usually. Plus, there's the "give up, show cached data" button for quite a while now anyway. I'll see whether to keep this check or ditch it if it continues to be annoying.

@Wilm0r Wilm0r closed this as completed Dec 14, 2024
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

2 participants