- git clone https://github.com/prerender/prerender.git
- cd prerender/
- #build and install # you will need nodejs's npm utility
- npm install
- node server.js
Indicate to the crawler that your site supports the AJAX crawling scheme :
replace all hash("#") with hash-bang("#!")
To handle pages without hash fragments put this in those pages
<meta name="fragment" content="!">
pom.xml :
//add this survlet filter( https://github.com/greengerong/prerender-java ) in your pom.xml:
- <dependency>
- <groupId>com.github.greengerong</groupId>
- <artifactId>prerender-java</artifactId>
- <version>1.6.2</version>
- </dependency>
web.xml :
//prerender-java client bug 1.6.2
you have to include this tag
<init-param>
<param-name>extensionsToIgnore</param-name>
<param-value>.xml</param-value>
</init-param>
//for 1.6.3 this is not required, but it's not yet in central maven repository
all Other clients list :
https://github.com/prerender/prerender#middleware
Testing:
git clone https://github.com/ahmedmohiduet/ng-prerender-demo.gitcd ng-prerender-demo
mvn clean install tomcat7:run
curl -A "GoogleBot" http://localhost:9966/ng-prerender-demo/
#don't forget to put / at the end
curl http://10.0.0.52:9966/ng-prerender-demo/
#note the difference
you can also show them sample content:
http://localhost:3000/http://www.flipclub.com/card/422/Archaeology-1
or
http://service.prerender.io/http://www.flipclub.com/card/422/Archaeology-1
You can also use service : http://service.prerender.io/
Prerender caches :
* In-memory html cache (just uncomment this line at https://github.com/prerender/prerender/blob/master/server.js#L18 and in-memory cache will b enabled.)
* Amazon s3
* Redis Cache
* Your Own Implementation ( Example : https://github.com/lammertw/prerender-mongodb-cache )
* More.*..
It's paid version provides automatic caching of pages and persistent cache automatically gets synchronized.
- <filter>
- <filter-name>prerender</filter-name>
- <filter-class>com.github.greengerong.PreRenderSEOFilter</filter-class>
- <init-param>
- <param-name>prerenderServiceUrl</param-name>
- <param-value>http://localhost:3000</param-value>
- </init-param>
- <init-param>
- <param-name>crawlerUserAgents</param-name>
- <param-value>yourOwnCrawler</param-value>
- </init-param>
- <init-param>
- <param-name>extensionsToIgnore</param-name>
- <param-value>.xml</param-value>
- </init-param>
- </filter>
- <!--default crawlers "googlebot", "yahoo", "bingbot", "baiduspider",
- "facebookexternalhit", "twitterbot", "rogerbot", "linkedinbot", "embedly" -->
- <filter-mapping>
- <filter-name>prerender</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
//prerender-java client bug 1.6.2
you have to include this tag
<init-param>
<param-name>extensionsToIgnore</param-name>
<param-value>.xml</param-value>
</init-param>
//for 1.6.3 this is not required, but it's not yet in central maven repository
all Other clients list :
https://github.com/prerender/prerender#middleware
Testing:
git clone https://github.com/ahmedmohiduet/ng-prerender-demo.gitcd ng-prerender-demo
mvn clean install tomcat7:run
curl -A "GoogleBot" http://localhost:9966/ng-prerender-demo/
#don't forget to put / at the end
curl http://10.0.0.52:9966/ng-prerender-demo/
#note the difference
you can also show them sample content:
http://localhost:3000/http://www.flipclub.com/card/422/Archaeology-1
or
http://service.prerender.io/http://www.flipclub.com/card/422/Archaeology-1
You can also use service : http://service.prerender.io/
Prerender caches :
* In-memory html cache (just uncomment this line at https://github.com/prerender/prerender/blob/master/server.js#L18 and in-memory cache will b enabled.)
* Amazon s3
* Redis Cache
* Your Own Implementation ( Example : https://github.com/lammertw/prerender-mongodb-cache )
* More.*..
It's paid version provides automatic caching of pages and persistent cache automatically gets synchronized.
No comments:
Post a Comment