Giter VIP home page Giter VIP logo

prerender-cloudfront's People

Contributors

amshee avatar benjaminlong avatar brennick avatar jinty avatar theworkflow avatar thoop avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

prerender-cloudfront's Issues

Add support for Googlebot, Bingbot, and Yandex

Thanks for making this repo. I've had a few people use it so far and say it works great!

One thing I noticed is that the URL isn't checked for _escaped_fragment_ so the crawlers that currently support it (Googlebot for now, Bingbot, and Yandex) are not served prerendered pages.

That should be a pretty easy check to add just before here.

Either that, or Googlebot, bingbot, and Yandex user agents should be added to the default list of user agents being checked. John Mueller has stated that as long as your prerendered content you serve back to Googlebot based on a user agent check is identical to the page your users see, you won't be penalized for cloaking in that case: https://groups.google.com/d/msg/js-sites-wg/CkLSG3TxxK0/LSJtiDxNCwAJ

Passing querystring to Prerender

It seems like the setup is not able to pass querystring to prerender.io?
Because we are passing this as the final path: [{ key: 'X-Prerender-Host', value: host[0].value}]

So let's say I want to prerender https://www.example.com/product?id=1, the final rendered page will be https://www.example.com/product because it's not passing the query string

Avoid cloudfront caching on pre render request

Hello!

I would like to apologize if this questions have been already answered before, but I am having an issue using cloudfront + pre render.

Question 1

When google bot/others bots do the request for website, cloudfront is caching prerender html response and always delivering HTML content, does not matters if the request is coming from a browser or a bot.

The question is: How can I tell cloudfront to not cache content if the response is pre rendered html? I think will be something as the project described in this quote:

"As prerender.io does NOT want any Cloudfront caching (see prerender/prerender#93 (comment)) we disable that by including a X-Prerender-Cachebuster header which effectively disables cloudfront caching."

Anyone has faced same problem and found out a solution? Everything is working fine except this strange cache behaviour.

I will keep searching and If I found a solution I will update this issue.

Many Thanks!

Prerender.io cached version has removed the script tag from html

I followed through each of the steps in attempt to test if this working and after everything is completed, the website works as expected when viewed in browser or curl request without header but when I send a curl request with the user agent header, the html that is returned doesn't contain any script tag and the content still says: "Loading from javascript..."

Installation on existing S3 CloudFront CI/CD

I would like to implement this as a solution for my current site, however I'm not certain how to use the example as it sits. Is there a installation guide that would walk me through implementing on an existing S3 CloudFront hosted site?

Some users are getting error pages

Hi, we implemented this for our site and for some users it seems to provide the correct page for others it returns a message saying "Sorry we cannot seem to find the page you are looking for". It appears that the lambda considers normal users as a bot. Can you please suggest, what can be done to fix this issue.

I have attached couple of screen shots

  1. The response error page
    Screenshot from 2023-01-21 11-06-00

  2. The response header suggesting that lambda triggered prerender
    Screenshot from 2023-01-21 11-08-06

This solution will not work with Amplify for Next.js using SSR

After a lengthy conversation with AWS support, they came to the conclusion that you cannot have a CloudFront distribution in front of an Amplify App that also uses a CLoudFront distribution. This is true for Apps that are running Next.js with SSR, as we are.

AWS confirms that presently there is no solution to utilize prerender.io with Amplify in this fashion. From AWS support:
Hello,

I did have a discussion on this with the Amplify Console team, and they confirmed that conclusion.

From AWS:

Support for prerender.io is currently not possible via an Amplify hosted SPA . There are 2 reasons for this (based on the CloudFront example from the GitHub ticket):

We don't associate any ViewerRequest Lambda@Edge with the managed CloudFront distribution, so we won't be able to add new headers based on the user-agent, query_string etc. before the request reaches the CDN.
Even if we were to workaround that by handling everything beyond the CDN (The customer would still have to work with a 2 second TTL), we don't have a way to achieve a redirect to any prerender.io server since our OriginRequest Lambda@Edge implementation does not support this customization.

Now support for this may be added in the future as it has been something that has been requested by previously as well. Periodically check the release history on the Amplify Console GitHub page for the latest supported features [1].

Please reach out if you have any further questions.

References:
[1] https://github.com/aws-amplify/amplify-console

We value your feedback. Please share your experience by rating this correspondence using the AWS Support Center link at the end of this correspondence. Each correspondence can also be rated by selecting the stars in top right corner of each correspondence within the AWS Support Center.

Best regards,
Daniel S.
Amazon Web Services

nodejs10.x no longer supported in AWS

AWS cannot create this stack anymore because nodejs.10x is no longer supported when creating new lambda functions. AWS recommended to change this to nodejs14.x, which I did, and it worked.

Issue with cache

Hi, followed your code exactly. Problem is, it works immediately after publishing and doing invalidation, but within 12 hours, cloudfront serves the pre-render version regardless of whether you are browsing from a bot or a normal browser. Clearly an issue with cloudfront cache as it worked for a short time. Can you advise?

Images and css not loading for bots

I'm having an issue with images and css not loading for bots. If I'm understanding the issue correctly, the request at the edge location sees the user agent is a bot and sends the request (by passing cloud front cache) to the prerender server, it renders the page, caches it and returns the result with the full html.

When an image or css is with-in the HTML it's requested, the edge location sees it's a bot and sends the request to the prerender servers. But the prerender servers do not cache the assets.

All our assets are relative urls. Not sure if I just have something mis-configured or if the redirect needs to exclude redirection of assets.

serve prerendered pages to clients as well as crawlers

Hello, I am writing this question here because i found nowhere else to ask this.

Is there any way to configure this to redirect clients and crawlers both to the prerendered page. I mean to serve the prerendered site only. I tired keeping prerender=true in every case but that doesn't serve the page and doesn't cache it either. Any help is appreciated.

Does this work with AWS Amplify?

We are hosting a React single page app via AWS Amplify and need to serve crawlers (like Google search crawlers) a pre-rendered version of each page for SEO reasons.

I came across this repo here and wonder if anyone knows how would I go about configuring AWS Amplify to use it?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.