play-prerender


License

License

GroupId

GroupId

com.github.jarlakxen
ArtifactId

ArtifactId

play-prerender_2.10
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

jar
Description

Description

play-prerender
play-prerender
Project URL

Project URL

https://github.com/Jarlakxen/play-prerender
Project Organization

Project Organization

com.github.jarlakxen
Source Code Management

Source Code Management

https://github.com/Jarlakxen/play-prerender

Download play-prerender_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.jarlakxen/play-prerender_2.10/ -->
<dependency>
    <groupId>com.github.jarlakxen</groupId>
    <artifactId>play-prerender_2.10</artifactId>
    <version>1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.jarlakxen/play-prerender_2.10/
implementation 'com.github.jarlakxen:play-prerender_2.10:1.1'
// https://jarcasting.com/artifacts/com.github.jarlakxen/play-prerender_2.10/
implementation ("com.github.jarlakxen:play-prerender_2.10:1.1")
'com.github.jarlakxen:play-prerender_2.10:jar:1.1'
<dependency org="com.github.jarlakxen" name="play-prerender_2.10" rev="1.1">
  <artifact name="play-prerender_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.jarlakxen', module='play-prerender_2.10', version='1.1')
)
libraryDependencies += "com.github.jarlakxen" % "play-prerender_2.10" % "1.1"
[com.github.jarlakxen/play-prerender_2.10 "1.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.4
org.scala-lang : scala-reflect jar 2.10.4

provided (2)

Group / Artifact Type Version
com.typesafe.play : play_2.10 jar 2.3.0
com.typesafe.play : play-ws_2.10 jar 2.3.0

Project Modules

There are no modules declared in this project.

Play Prerender

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

Use this Spray directive 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: Prerender service will make a request to your server to render the HTML.

  1. Add this dependency on your project:
    "com.github.jarlakxen" %% "play-prerender" % "1.1"
  1. Add this line to your code:
     import play.prerender._
     
     object Global extends WithFilters(AjaxSEOFilter("http://service.prerender.io/")) with GlobalSettings;

How it works

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

Versions

Version
1.1