Page MenuHomeSoftware Heritage

settings/production: Disable per-site caching for authenticated users
ClosedPublic

Authored by anlambert on Mar 15 2021, 5:32 PM.

Details

Summary

Django per-site caching messes up some page rendering for authenticated
users when used in combination with gunicorn workers and memcached
(authenticated user is not reported as logged in).

So ensure per-site caching is disabled for authenticated users.

Other solution would be to remove django per-site caching as we already
have a varnish cache for the webapp so not sure it is really needed.

Test Plan

The rendering issue only occurs when using gunicorn and memcached, not
easy to test with pytest.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Build is green

Patch application report for D5251 (id=18829)

Rebasing onto a7819a8a55...

Current branch diff-target is up to date.
Changes applied before test
commit f8b2e8d0ccb5d81878ea429d8f5b85b926630902
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Mon Mar 15 17:25:23 2021 +0100

    settings/production: Disable per-site caching for authenticated users
    
    Django per-site caching messes up some page rendering for authenticated
    users when used in combination with gunicorn workers and memcached.
    
    So ensure per-site caching is disabled for authenticated users.

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/623/ for more details.

Update: Prefer to remove django per-site caching in production settings
as it is redundant with the varnish cache deployed in front of swh-web
in production.

Build is green

Patch application report for D5251 (id=18852)

Rebasing onto a7819a8a55...

Current branch diff-target is up to date.
Changes applied before test
commit a3eb1f6c00c871d458916f44fc040110297afac7
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Mon Mar 15 17:25:23 2021 +0100

    settings/production: Disable per-site caching for authenticated users
    
    Django per-site caching messes up some page rendering for authenticated
    users when used in combination with gunicorn workers and memcached.
    
    So remove per-site caching in production settings as it is not really
    needed plus it is redundant with the varnish cache already deployed
    in front of swh-web in production.

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/624/ for more details.

This revision is now accepted and ready to land.Mar 16 2021, 5:23 PM