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

Vary cached employer pages on authentication cookie #579

Open
hancush opened this issue Nov 18, 2021 · 3 comments
Open

Vary cached employer pages on authentication cookie #579

hancush opened this issue Nov 18, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@hancush
Copy link
Member

hancush commented Nov 18, 2021

We do a little do-si-do in the employer views to show the standardized export button conditional on whether a user is authenticated. Unfortunately, we cache those views, so this dance is not repeated for each viewer, but rather the first viewer to visit the uncached page.

We should vary the cache based on the authentication cookie. Django docs on:

It looks from analytics like a lot of traffic comes through person pages, i.e., a not insubstantial amount of employer views may be accessed for the first time by an unauthenticated user, because they aren't coming to the site through search, hiding the standardized data download, even for authenticated users. I don't think this is dire because the source document containing the same information is available to all users, regardless of authentication status, but wanted to note.

If we don't want to go down this rabbit hole, we could:

  • Unconditionally show the standardized data download button, though this exposes a heavy request to a larger number of users
    • Investigate options for a lighter standardized data download, such as baking out the exports after upload or on first download and storing them as static assets in S3
  • Not cache the employer views, though we'd incur a performance hit
  • Implement a clientside authentication dance, though this is annoying with the current implementation of the authentication plug-in (my bad)
  • Something else
@hancush hancush added the bug Something isn't working label Nov 18, 2021
@fgregg
Copy link
Member

fgregg commented Nov 18, 2021

I'd like to unconditionally show the standardized data download button until we have evidence that it is causing a problem.

@fgregg
Copy link
Member

fgregg commented Nov 18, 2021

@smcalilly, can you make that change

@smcalilly
Copy link
Contributor

@fgregg yep, doing it now

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

3 participants