All Projects → greengerong → Prerender Java

greengerong / Prerender Java

Licence: mit
java framework for prerender

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Prerender Java

Sitemap Generator Cli
Creates an XML-Sitemap by crawling a given site.
Stars: ✭ 214 (+86.09%)
Mutual labels:  crawler, seo
parcel-plugin-prerender
No description or website provided.
Stars: ✭ 42 (-63.48%)
Mutual labels:  seo, prerender
Arachnid
Crawl all unique internal links found on a given website, and extract SEO related information - supports javascript based sites
Stars: ✭ 224 (+94.78%)
Mutual labels:  crawler, seo
Rendora
dynamic server-side rendering using headless Chrome to effortlessly solve the SEO problem for modern javascript websites
Stars: ✭ 1,853 (+1511.3%)
Mutual labels:  crawler, seo
Prep
Pre-renders your web app (React, Vue, Angular, ...) into static HTML based on your specified routes enabling SEO for single page applications.
Stars: ✭ 371 (+222.61%)
Mutual labels:  seo, prerender
Sitemap Generator Crawler
Script that generates a sitemap by crawling a given URL
Stars: ✭ 169 (+46.96%)
Mutual labels:  crawler, seo
server-render-javascript
Prerender your javascript web page for better seo with PhantomJS. ⚠️ no es6 supported.
Stars: ✭ 12 (-89.57%)
Mutual labels:  seo, prerender
Ngmeta
Dynamic meta tags in your AngularJS single page application
Stars: ✭ 152 (+32.17%)
Mutual labels:  crawler, seo
Sitemap Generator
Easily create XML sitemaps for your website.
Stars: ✭ 273 (+137.39%)
Mutual labels:  crawler, seo
react-seo-friendly-spa-template
React PWA/SPA template initially scaffolded with CRA (Create React App) and configured for SEO. Makes use of prerendering and other techniques/packages in order to achieve a perfect "Lighthouse Score".
Stars: ✭ 24 (-79.13%)
Mutual labels:  seo, prerender
Vue Seo Prerender
Vue.js Tutorial: A Prerendered, SEO-Friendly Example
Stars: ✭ 139 (+20.87%)
Mutual labels:  seo, prerender
Usus
Webpage pre-rendering service. ⚡️
Stars: ✭ 804 (+599.13%)
Mutual labels:  seo, prerender
vue-seo-friendly-spa-template
Vue.js PWA/SPA template initially scaffolded with vue-cli and configured for SEO. Makes use of prerendering and other techniques/packages in order to achieve a perfect "Lighthouse Score".
Stars: ✭ 41 (-64.35%)
Mutual labels:  seo, prerender
spiderable-middleware
🤖 Prerendering for JavaScript powered websites. Great solution for PWAs (Progressive Web Apps), SPAs (Single Page Applications), and other websites based on top of front-end JavaScript frameworks
Stars: ✭ 29 (-74.78%)
Mutual labels:  crawler, seo
React Snap
👻 Zero-configuration framework-agnostic static prerendering for SPAs
Stars: ✭ 4,565 (+3869.57%)
Mutual labels:  seo, prerender
Prerender Spa Plugin
Prerenders static HTML in a single-page application.
Stars: ✭ 7,018 (+6002.61%)
Mutual labels:  seo, prerender
Linkcrawler
Cross-platform persistent and distributed web crawler 🔗
Stars: ✭ 109 (-5.22%)
Mutual labels:  crawler
Open Graph
Library that assists in building Open Graph meta tags
Stars: ✭ 112 (-2.61%)
Mutual labels:  seo
Lumberjack
An automated website accessibility scanner and cli
Stars: ✭ 109 (-5.22%)
Mutual labels:  crawler
Fawkes
Fawkes is a tool to search for targets vulnerable to SQL Injection. Performs the search using Google search engine.
Stars: ✭ 108 (-6.09%)
Mutual labels:  crawler

Prerender Java Build Status

Are you using backbone, angular, emberjs, etc, but you're unsure about the SEO implications?

Use this java filter that prerenders a javascript-rendered page using an external service and returns the HTML to the search engine crawler for SEO.

Note: If you are using a # in your urls, make sure to change it to #!. View Google's ajax crawling protocol

Note: Make sure you have more than one webserver thread/process running because the prerender service will make a request to your server to render the HTML.

1:Add this line to your web.xml:

<filter>
      <filter-name>prerender</filter-name>
      <filter-class>com.github.greengerong.PreRenderSEOFilter</filter-class>
      <init-param>
          <param-name>prerenderToken</param-name>
          <param-value>[get from prerender: https://prerender.io/]</param-value>
      </init-param>
  </filter>
  <filter-mapping>
      <filter-name>prerender</filter-name>
      <url-pattern>/*</url-pattern>
  </filter-mapping>

2:add dependency on your project pom:

<dependency>
  <groupId>com.github.greengerong</groupId>
  <artifactId>prerender-java</artifactId>
  <version>1.6.4</version>
</dependency>

How it works

  1. Check to make sure we should show a prerendered page
    1. Check if the request is from a crawler (_escaped_fragment_ or agent string)
    2. Check to make sure we aren't requesting a resource (js, css, etc...)
    3. (optional) Check to make sure the url is in the whitelist
    4. (optional) Check to make sure the url isn't in the blacklist
  2. Make a GET request to the prerender service(phantomjs server) for the page's prerendered HTML
  3. Return that HTML to the crawler

Customization

crawlerUserAgents

example: someproxy,someproxy1

whitelist

blacklist

forwardedURLHeader

Important for servers behind reverse proxy that need the public url to be used for pre-rendering. We usually set the original url in an http header which is added by the reverse proxy (similar to the more standard x-forwarded-proto and x-forwarded-for)

protocol

If you specifically want to make sure that the Prerender service queries using https or http protocol, you can set the init-param protocol to https or http respectively.

Using your own prerender service

If you've deployed the prerender service on your own, set the PRERENDER_SERVICE_URL environment variable so that this package points there instead. Otherwise, it will default to the service already deployed at http://service.prerender.io/

$ export PRERENDER_SERVICE_URL=<new url>

Or on heroku:

$ heroku config:add PRERENDER_SERVICE_URL=<new url>

As an alternative, you can pass prerender_service_url in the options object during initialization of the middleware

 config filter init param with "prerenderServiceUrl";

prerender service token

If you want to use token with the prerender service, you can config it.

 config filter init param with "prerenderToken";

prerender event handler

If you want to cache the caching, analytics, log or others, you can config it. It should be instance of "com.github.greengerong.PreRenderEventHandler"

 config filter init param with "preRenderEventHandler";

Testing

If your URLs use a hash-bang:

If you want to see `http://localhost:3000/#!/profiles/1234`
Then go to `http://localhost:3000/?_escaped_fragment_=/profiles/1234`

If your URLs use push-state:

If you want to see `http://localhost:3000/profiles/1234`
Then go to `http://localhost:3000/profiles/1234?_escaped_fragment_=`

project demo test url:

http://localhost:8080/test/?_escaped_fragment_=

License

The MIT License (MIT)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].