Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Og membership state cache context #163

Merged
merged 20 commits into from
Sep 20, 2016

Conversation

amitaibu
Copy link
Member

@amitaibu amitaibu commented Sep 4, 2016

illum_wisi___site-install

@amitaibu
Copy link
Member Author

amitaibu commented Sep 4, 2016

Update: I'm still seeing X-Drupal-Dynamic-Cache:MISS, so need to figure out what is the cause (not necessarily OG in this case)

@amitaibu
Copy link
Member Author

amitaibu commented Sep 4, 2016

/cc @pfrenssen

@amitaibu amitaibu changed the title WIP: Og membership statuses cache context WIP: Og membership state cache context Sep 4, 2016
@amitaibu
Copy link
Member Author

amitaibu commented Sep 4, 2016

Things I need to figure (but pointers would be appreciated of course):

  1. I see a cache miss also when same auth user viewes a non-Og node
  2. I don't see the return value under the cache tags. I would expect to see og_membership_state:none or og_membership_state:active
  3. How can I see which cache context caused the invaldiation

@pfrenssen
Copy link
Contributor

Following this with great interest. I'm going to try to get some time assigned to review this.

@amitaibu
Copy link
Member Author

amitaibu commented Sep 7, 2016

@pfrenssen hi! In the mean time @DavidHernandez and me were able to add unit tests :)

@amitaibu amitaibu changed the title WIP: Og membership state cache context Og membership state cache context Sep 7, 2016
public function getContext() {
if (!$route_contexts = $this->routeMatch->getRouteObject()->getOption('parameters')) {
// No "parameters" defined in the route.
return 'none';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a constant instead of hardcoding none?

@amitaibu
Copy link
Member Author

I've disabled development mode on my local, and was able to see a cache: HIT.

@amitaibu
Copy link
Member Author

Oh, I thought I got it in already. Fixed the sniffer mistakes. Once green, I'll merge.

@amitaibu amitaibu merged commit 2774998 into Gizra:8.x-1.x Sep 20, 2016
@amitaibu amitaibu deleted the OgMembershipStatusesCacheContext branch September 20, 2016 04:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants