Git Product home page Git Product logo

meteor-prerender's Introduction

โš ๏ธ This package is unmaintained!

The Meteor Development Group has taken over maintaining this package. Use mdg:seo instead.

The issues of this repository are closed! Please file new issues at its new home in meteor/galaxy-seo-package.

Prerender

SEO for Meteor Apps. A Meteor wrapper for https://prerender.io/.

Build Status

Intention

This package is a reference on how to enable Prerender in pre-1.3 Meteor applications. If you need anything more sophisticated, create an inlined package in your project. It's just a few lines of code.

Usage with Meteor 1.3

Meteor 1.3 supports inclusion of npm modules out of the box. If you use Meteor 1.3, use the prerender-node npm module directly. You don't need this package at all in this case.


Setup

Install with

$ meteor add dferber:prerender

In your settings.json file include:

settings.json

{
  "PrerenderIO": {
    "serviceUrl": "http://localhost:3033/",
    "token": "yourtoken"
  }
}

The serviceURL is optional and only used to test the Prerender server locally. Leave it out in your production configuration.

NOTICE: You may also provide the above credentials using environment variables, namely PRERENDERIO_TOKEN and PRERENDERIO_SERVICE_URL. They precede the configuration from the settings file.

Testing and Verifying

There are two options to test whether Prerender is working or not.

Locally (recommended)

  1. Set the serviceUrl to http://localhost:3033/.
  2. Download the open source Prerender server to another directory
  3. Run the Prerender server with a custom port locally (because 3000 is taken by your Meteor app), with $ export PORT=3033; node server.js
  4. Visit any URL of your application and append ?_escaped_fragment_=, e.g. http://localhost:3000/?escaped_fragment=

This will show you the version Prerender generated and search engines will see. You can view logs in the running prerender server which is quite helpful.

Using the Prerender service

  1. Set the serviceUrl to http://service.prerender.io/.
  2. Visit any URL of your application and append ?_escaped_fragment_=, e.g. http://localhost:3000/?escaped_fragment=
  3. See what is reported to Prerender at https://prerender.io/,

For more options, take a look at the prerender-node package.

Delaying the rendering

Sometimes the content will not show up immediately and all Prerender sees are loading spinners. This happens because Prerender uses the HTML too early, while the subscriptions are still loading.

Set window.prerenderReady = false; in the client side code. This will tell Prerender to wait. When your content is loaded, set it to true and Prerender will use that version. It's also possible to never set it to true. The request will then time out after about 20 seconds and Prerender will use whatever is on the screen.

Possible Errors

Error: connect ECONNREFUSED
    at errnoException (net.js:905:11)
    at Object.afterConnect [as oncomplete] (net.js:896:19)

If you get this error, you probably forgot to run your local Prerender server.

Prior Art

The initial version by @dfischer uses the outdated prerender-node module. This package uses the latest version, allowing it to work without all the boilerplate.

This package further uses Meteors extension of Semantic Versioning, which keeps the released version consistent with that of the prerender-node npm module.

As the configuration can be reused switching from the previous package to this one is as easy as

$ meteor remove dfischer:prerenderio
$ meteor add dferber:prerender

Contributions

Thanks to @electricjesus and @dfischer for the initial version. Thanks to @arunoda for simplifying prerender-node.

meteor-prerender's People

Contributors

dferber90 avatar greenkeeperio-bot avatar isalmogk avatar rikonor avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

meteor-prerender's Issues

Brings in Blaze & jQuery to client

Everything is working fine, but this package is relying on Templating that is bringing it in client side and bringing Blaze & jQuery along with it. :(

Not working

Hey,
I'm just using your package but it isn't working for me. If I call my url with the escaped fragment, my Prerender server logs the call, but I get redirected to my root url without the escaped fragment. It is possible that it collides with force-ssl?

Not working behind Nginx

I'm running two apps from the code base at two different urls.

One of the apps works fine with this package and all is in order when I go to: https://prerender.io/crawl-stats.

The second app doesn't work however and I see the following at https://prerender.io/crawl-stats:
http://myapp/post/abc (which obviously causes an error).

The root url should is https://myapp.com/ so I'm expecting to see https://somewebsite.com/post/abc on the crawl-stats page.

The difference between the two sites is that one is behind an nginx (used for ssl and as a load balancer). myapp is the appName I gave in my mup.json file (deploying with Meteor Up).

Do you have any idea why these issues are being caused? And I do have to stick the prerender.io stuff in my nginx config file instead to make this work?

Protocol option not supported

Hi the http / https protocol is not supported, it is supported in the node package version. You need this if your site / app is using https. Any plans to add this?

Error: Cannot read property 'access-control-allow-origin' of null

Hey,

Since about November, I've been seeing issues with using mdg:seo on Galaxy, getting the same error as seen here. I had to stop using the package because it caused rolling container crashes.

I assumed that it may have been an issue between Galaxy and Prerender, but when using your package earlier, I can into the same issue on my localhost.

The person that raised the issue over on mdg:seo speculated that it may be an interaction with the meteor hacks:inject-data package?

What would you say is the best way to resolve this issue, or use the NPM version of prerender-node directly? (I'm running Meteor 1.3+)

Cheers! Jamie.

google boot issue

Hello,

I got an email from prerender and it said that I have to update my prerneder middleware version to support google boot.

I am using this repository so I am asking that what should I do for the email?

Thank you!! below is the email from prerender.


Hi there,

Please upgrade your Prerender.io middleware to the latest version or manually modify it to check for Googlebot by their user agent directly.

This is for your Prerender.io account under the email address of [email protected].

Google is moving away from crawling escaped_fragment URLs and some users have reported this causing issues with their SEO.

You can find information on Google's change and how to upgrade or add Googlebot's user agent to your middleware here:

https://prerender.io/documentation/google-support

I'll check your account again soon and I'll follow up with you if I don't see prerendered pages being returned to Googlebot directly.

Please respond to this email if you have any questions.

Best,

Todd Hooper
Founder, Lead Engineer

Prerender not working on my app

Hi, I have deployed my app with mupx on digital ocean, and I have followed the instructions on your README.MD but it appears that prerender.io is not seeing my app here is my setup

settings.js

{
    "public": {
        "ga": {
            "id": "UA-XXXXXXXX-1"
        },
        "PrerenderIO": {
            "serviceUrl": "http://service.prerender.io/",
            "token": "wi7Dqa...................qTGmT"
          }
    }
}

I have installed my token and your package. how do I know if this is working? i have also tried installing the prerender server locally but i have issues with this too.

When I go to prerender i still see the prompt which says i should install my token on my site.

I also submitted my website's sitemap to prerender.io which means it has cached my pages (manually).

With all these, I'm not sure prerender is working on my app

blacklisted not working?

Hi,

I attempted to add the following to my client-side ๐Ÿ‘
prerenderio.blacklisted('/result');

so that it stops caching my urls that contain www.example.com**/result**/test

However, I see in Prerender.io is still caching these links?

If I try to add the prerenderio to the server side it says that prerenderio is undefined.

host issue

Hi,

for a reason I haven't figured out why the host is set as px 'example' while it should be 'example.com', so all attempts to prerender.io calls miss.
I have downloaded a local copy and added prerenderio.set('host', host); with host being a value from the settings file.

Anyone has faced the same issue? It would be nice to add it as optional also in the package.

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.