Details

    • Epic Link:
    • Sprint:
      Aconcagua Sprint 1, Aconcagua Sprint 2
    • Story Points:
      3

      Description

      At the moment, HttpCache is completely public and only vary on the ETag, not on a user based information.

      To make the cache vary on the user hash (like it was the case in legacy), we need to rely on a custom Http request header (e.g. X-User-Hash).

      $response = new Response();
      $response->setVary( 'X-User-Hash' );
      

      To make this possible, we need to calculate and store this user hash somehow at login time, in a cookie for instance. Thus, the reverse proxy (Symfony one or Varnish) can extract it and set the custom request header in a very easy way.

      Solution

      • In user/login legacy module, compute the user hash when the user is logged in.
      • Trigger an user/login ezpEvent (filter type to be able to pass the computed user hash)
      • From Symfony, attach a listener to this event and make it set the cookie
      • In Symfony reverse proxy (HttpCache), catch the cookie if present and set the value in X-User-Hash request header before the lookup action.

        Issue Links

          Activity

          Show
          Jérôme Vieilledent (Inactive) added a comment - - edited Pull-requests: ezpublish-kernel: https://github.com/ezsystems/ezpublish-kernel/pull/368 ezpublish-community: https://github.com/ezsystems/ezpublish-community/pull/65 DemoBundle: https://github.com/ezsystems/DemoBundle/pull/11
          Show
          Jérôme Vieilledent (Inactive) added a comment - Implemented in: ezpublish-kernel: https://github.com/ezsystems/ezpublish-kernel/commit/ec6deea589d37afae38ff6403efd26439daa1207 ezpublish-community: https://github.com/ezsystems/ezpublish-community/commit/fc1569f8f0bc8c351b84d973c748f4ecbdac7668 DemoBundle: https://github.com/ezsystems/DemoBundle/commit/133c1934b6a4f5ec1831e36481448141431ede32

            People

            • Assignee:
              Unassigned
              Reporter:
              Jérôme Vieilledent (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 3 days Original Estimate - 3 days
                3d
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days, 2 hours, 30 minutes
                4d 2h 30m

                  Agile