PHPackages                             yucca/prerender-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. yucca/prerender-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

yucca/prerender-bundle
======================

Allows you to easily use prerender for your Symfony apps running Client-Side MVC

3.2(7y ago)5617.1k15[8 issues](https://github.com/rjanot/YuccaPrerenderBundle/issues)MITPHPPHP &gt;=7

Since Oct 13Pushed 7y ago6 watchersCompare

[ Source](https://github.com/rjanot/YuccaPrerenderBundle)[ Packagist](https://packagist.org/packages/yucca/prerender-bundle)[ Docs](http://rjanot.github.io/)[ RSS](/packages/yucca-prerender-bundle/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (9)Used By (0)

Yucca/PrerenderBundle
=====================

[](#yuccaprerenderbundle)

[![Build Status](https://camo.githubusercontent.com/d632b1de64fcce42431b14f96230def746738dedd96475915da5a6cdf4b6b196/68747470733a2f2f7472617669732d63692e6f72672f726a616e6f742f597563636150726572656e64657242756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/rjanot/YuccaPrerenderBundle)[![Coverage Status](https://camo.githubusercontent.com/bfbd0d702e69076a6d8ce0dbec46ee802012a97159a1c295becb3e5009034db0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f726a616e6f742f597563636150726572656e64657242756e646c652f62616467652e706e67)](https://coveralls.io/r/rjanot/YuccaPrerenderBundle)

Backbone, EmberJS, Angular and so more are your daily basis ? In case of an admin area, that's fine, but on your front office, you might encounter some SEO problems

Thanks to [Prerender.io](http://www.prerender.io), you now can dynamically render your JavaScript pages in your server using PhantomJS.

This bundle is largely inspired by bakura10 work on [zfr-prerender](https://github.com/zf-fr/zfr-prerender)

Installation
------------

[](#installation)

Install the module by typing (or add it to your `composer.json` file):

```
$ php composer.phar require "yucca/prerender-bundle" "0.1.*@dev"
```

Register the bundle in `app/AppKernel.php`:

```
// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Yucca\PrerenderBundle\YuccaPrerenderBundle(),
    );
}

```

Enable the bundle's configuration in `app/config/config.yml`:

```
# app/config/config.yml
yucca_prerender: ~

```

Documentation
-------------

[](#documentation)

### How it works

[](#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...)
    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](https://github.com/collectiveip/prerender) (PhantomJS server) for the page's prerendered HTML
3. Return that HTML to the crawler

### Customization

[](#customization)

This bundle comes with a sane default, extracted from [prerender-node middleware](https://github.com/collectiveip/prerender-node), but you can easily customize it:

```
#app/config/config.yml
yucca_prerender:
    ....

```

#### Prerender URL

[](#prerender-url)

By default, YuccaPrerenderBundle uses the Prerender.io service deployed at `http://prerender.herokuapp.com`. However, you may want to [deploy it on your own server](https://github.com/collectiveip/prerender#deploying-your-own). To that extent, you can customize YuccaPrerenderBundle to use your server using the following configuration:

```
#app/config/config.yml
yucca_prerender:
    backend_url: http://localhost:3000

```

With this config, here is how YuccaPrerender will proxy the "" request:

`GET`

#### Crawler user-agents

[](#crawler-user-agents)

YuccaPrerender decides to pre-render based on the User-Agent string to check if a request comes from a bot or not. By default, those user agents are registered: 'baiduspider', 'facebookexternalhit', 'twitterbot'. Googlebot, Yahoo, and Bingbot should not be in this list because we support *escaped\_fragment* instead of checking user agent for those crawlers. Your site must have to understand the '#!' ajax url notation.

You can add other User-Agent string to evaluate using this sample configuration:

```
#app/config/config.yml
yucca_prerender:
    crawler_user_agents: ['yandex', 'msnbot']

```

#### Ignored extensions

[](#ignored-extensions)

YuccaPrerender is configured by default to ignore all the requests for resources with those extensions: `.js`, `.css`, `.less`, `.png`, `.jpg`, `.jpeg`, `.gif`, `.pdf`, `.doc`, `.txt`, `.zip`, `.mp3`, `.rar`, `.exe`, `.wmv`, `.doc`, `.avi`, `.ppt`, `.mpg`, `.mpeg`, `.tif`, `.wav`, `.mov`, `.psd`, `.ai`, `.xls`, `.mp4`, `.m4a`, `.swf`, `.dat`, `.dmg`, `.iso`, `.flv`, `.m4v`, `.torrent`. Those are never pre-rendered.

You can add your own extensions using this sample configuration:

```
#app/config/config.yml
yucca_prerender:
    ignored_extensions: ['.less', '.pdf']

```

#### Whitelist

[](#whitelist)

Whitelist a single url path or multiple url paths. Compares using regex, so be specific when possible. If a whitelist is supplied, only url's containing a whitelist path will be prerendered.

Here is a sample configuration that *only* pre-render URLs that contains "/users/":

```
#app/config/config.yml
yucca_prerender:
    whitelist_urls: ['/users/*']

```

> Note: remember to specify URL here and not Symfony2 route names.

#### Blacklist

[](#blacklist)

Blacklist a single url path or multiple url paths. Compares using regex, so be specific when possible. If a blacklist is supplied, all url's will be pre-rendered except ones containing a blacklist part. Please note that if the referer is part of the blacklist, it won't be pre-rendered too.

Here is a sample configuration that prerender all URLs *excepting* the ones that contains "/users/":

```
#app/config/config.yml
yucca_prerender:
    blacklist_urls: ['/users/*']

```

> Note: remember to specify URL here and not Symfony22 route names.

### Testing

[](#testing)

If you want to make sure your pages are rendering correctly:

1. Open the Developer Tools in Chrome (Cmd + Atl + J)
2. Click the Settings gear in the bottom right corner.
3. Click "Overrides" on the left side of the settings panel.
4. Check the "User Agent" checkbox.
5. Choose "Other..." from the User Agent dropdown.
6. Type googlebot into the input box.
7. Refresh the page (make sure to keep the developer tools open).

Thanks
======

[](#thanks)

- Thanks to [bakura10](https://github.com/zf-fr/zfr-prerender) for the Zend Framework version.
- Thanks to [Romain Boyer](https://twitter.com/RomainBOYER) to make me discover prerender.io
- Thanks to the prerender team and all JS MVC developpers

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 78.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~272 days

Recently: every ~323 days

Total

8

Last Release

2727d ago

Major Versions

1.4 → 3.02018-01-12

PHP version history (2 changes)1.0PHP &gt;=5.3.2

3.0PHP &gt;=7

### Community

Maintainers

![](https://www.gravatar.com/avatar/df5d5cb857bee815e404964c06d693da0ec39e6658d915578eb11aa0c6200838?d=identicon)[rjanot](/maintainers/rjanot)

---

Top Contributors

[![rjanot](https://avatars.githubusercontent.com/u/630380?v=4)](https://github.com/rjanot "rjanot (30 commits)")[![tomfun](https://avatars.githubusercontent.com/u/5002775?v=4)](https://github.com/tomfun "tomfun (8 commits)")

---

Tags

prerenderMVC js

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yucca-prerender-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/yucca-prerender-bundle/health.svg)](https://phpackages.com/packages/yucca-prerender-bundle)
```

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[web-auth/webauthn-framework

FIDO2/Webauthn library for PHP and Symfony Bundle.

51090.8k2](/packages/web-auth-webauthn-framework)[kimai/kimai

Kimai - Time Tracking

4.7k8.7k1](/packages/kimai-kimai)[ecotone/ecotone

Enterprise architecture layer for Laravel and Symfony — CQRS, Event Sourcing, Durable Workflows (Sagas, Orchestrators), Projections, and Outbox messaging via PHP attributes.

562565.8k42](/packages/ecotone-ecotone)[metamodels/core

MetaModels core

9956.1k68](/packages/metamodels-core)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1155.2k](/packages/rcsofttech-audit-trail-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
