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

x/pkgsite: implement cache invalidation #44217

Closed
jba opened this issue Feb 11, 2021 · 4 comments
Closed

x/pkgsite: implement cache invalidation #44217

jba opened this issue Feb 11, 2021 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite

Comments

@jba
Copy link
Contributor

jba commented Feb 11, 2021

The worker should invalidate the cache for a module when it processes the latest version.

This will allow us to get rid of HTML replacements (#44210) without worrying about stale data.

@jba jba added NeedsFix The path to resolution is known, but the work has not been done. pkgsite labels Feb 11, 2021
@jba jba added this to the pkgsite/unplanned milestone Feb 11, 2021
@jba jba self-assigned this Feb 11, 2021
@gopherbot
Copy link

Change https://golang.org/cl/291250 mentions this issue: internal/{middleware,worker}: use internal/cache

@gopherbot
Copy link

Change https://golang.org/cl/291249 mentions this issue: internal/cache: factor out cache into its own package

@gopherbot
Copy link

Change https://golang.org/cl/291270 mentions this issue: internal/postgres: InsertModule returns isLatest

@gopherbot
Copy link

Change https://golang.org/cl/291369 mentions this issue: internal/worker: invalidate cache

gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 11, 2021
Put the Redis-based page cache logic into its own
package.

Mostly for the non-trivial DeletePrefix method.

For golang/go#44217

Change-Id: I7248f60b5d71402a38ebd4c96143a70e21ae3c63
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/291249
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 11, 2021
Replace direct calls on the redis cache client with
calls to the new internal/cache package.

For golang/go#44217

Change-Id: I0d16f810c8455a6a23f9275f1c5e554e37ba86bc
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/291250
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
gopherbot pushed a commit to golang/pkgsite that referenced this issue Feb 11, 2021
InsertModule reports whether it just inserted the latest version
of a module.

We'll use this information later to determine whether to invalidate
the cache.

Also, rewrite tests to use postgres.MustInsertModule.

For golang/go#44217

Change-Id: I8bed8aa8e86a347a4add85c2b16c549b7ad740f0
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/291270
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
@golang golang locked and limited conversation to collaborators Feb 12, 2022
@rsc rsc unassigned jba Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. pkgsite
Projects
None yet
Development

No branches or pull requests

2 participants