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

✨ amp-next-page: Rewrite URLs to fetch from the cache when serving from the cache #14633

Merged

Conversation

peterjosling
Copy link
Contributor

  • Allows for publishers to serve the same set of URLs for both canonical/cache
  • Avoids making cross-origin requests from the cache, and ensures that the requested document is valid

@peterjosling
Copy link
Contributor Author

@aghassemi

@peterjosling peterjosling force-pushed the document-recommendations-cache-url branch from 6d79525 to 3fe3abd Compare April 16, 2018 15:03
@aghassemi aghassemi self-requested a review April 16, 2018 18:18

if (isProxyOrigin(url)) {
const sourceOrigin = getSourceOrigin(url);
configJson.pages.forEach(rec => {
Copy link
Contributor

@aghassemi aghassemi Apr 16, 2018

Choose a reason for hiding this comment

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

should become configJson['pages'] and handle the edge case where it may be null or not be an array. @peterjosling

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, should've been this.config_.pages.

null/isArray checks already done in assertConfig.

@peterjosling peterjosling force-pushed the document-recommendations-cache-url branch from 3fe3abd to 76393fd Compare April 17, 2018 10:30
- Allows for publishers to serve the same set of URLs for both canonical/cache
- Avoids making cross-origin requests from the cache, and ensures that the requested document is valid
@peterjosling peterjosling force-pushed the document-recommendations-cache-url branch from 76393fd to b851504 Compare April 17, 2018 12:46
@aghassemi aghassemi merged commit 331f6db into ampproject:master Apr 17, 2018
@peterjosling peterjosling deleted the document-recommendations-cache-url branch April 17, 2018 16:55
jridgewell pushed a commit to jridgewell/amphtml that referenced this pull request Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants