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

Fix #2885 Landing page always shows sign up button for private marketplaces #2944

Merged
merged 2 commits into from Apr 24, 2017

Conversation

rap1ds
Copy link
Member

@rap1ds rap1ds commented Apr 21, 2017

Problem: See #2885 for detailed description about the issue

Solution:

  • Disable browser cache for private marketplaces
  • Cache two versions based on the cta (which can be either signup or search) for private marketplace.

@rap1ds
Copy link
Member Author

rap1ds commented Apr 21, 2017

Uh, tests are failing. I'll fix them

def fetch_cached_content(community_id, version, digest)
Rails.cache.read("clp/#{community_id}/#{version}/#{digest}")
def fetch_cached_content(community_id, version, digest, cta)
Rails.cache.read("clp/#{community_id}/#{version}/#{digest}/#{cta}")
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure you need cta in the content cache keys. The content is different, so the digest will be different. As long as you have the meta based on the correct cta, it should be fine.

end

def cache_content!(community_id, version, locale, content, cache_time)
def cache_content!(community_id, version, locale, content, cache_time, cta)
Copy link
Member

Choose a reason for hiding this comment

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

Same as above

def write_cached_content!(community_id, version, content, digest, cache_time)
Rails.cache.write("clp/#{community_id}/#{version}/#{digest}", content, expires_in: cache_time)
def write_cached_content!(community_id, version, content, digest, cache_time, cta)
Rails.cache.write("clp/#{community_id}/#{version}/#{digest}/#{cta}", content, expires_in: cache_time)
Copy link
Member

Choose a reason for hiding this comment

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

Same as above.

end

## Internal, use cache_content! instead
def write_cached_content!(community_id, version, content, digest, cache_time)
Rails.cache.write("clp/#{community_id}/#{version}/#{digest}", content, expires_in: cache_time)
Rails.cache.write("clp/#{community_id}/#{version}/#{digest}/", content, expires_in: cache_time)
Copy link
Member

Choose a reason for hiding this comment

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

Runaway trailing /

@rap1ds rap1ds merged commit cfb0091 into master Apr 24, 2017
@thomasmalbaux thomasmalbaux deleted the private-landing-page branch May 29, 2017 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants