All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning.
- Whoops. Make sure
shouldEncodeURLBeforeBrowserFetch
defaults to true.
- Added
shouldEncodeURLBeforeBrowserFetch
to allow projects that use prerender to determine whether they want to callencodeURI
on the URL before fetching it in PhantomJS. Useful for some URLs that might have encoded slashes in them, since encoding them further would cause incorrect behavior.
- Fixed issue where PhantomJS crashed and then disposing caused bad phantomjs state
- Bumped all dependency versions to latest
- Added ability for cluster master to kill last known phantomjs pid for a worker if the worker dies (preventing orphaned phantomjs instances)
- Better terminating for cluster workers
- Added NUM_SOFT_ITERATIONS to try to kill phantomjs and reclaim memory when no requests are in flight. This should be set to a low number (1-10) so that PhantomJS can be restarted often when it isn't doing anything else. NUM_ITERATIONS should still be set to something like 40-50 to make sure to force kill PhantomJS even if a request is in flight.
- Added clearing of memory cache to prevent PhantomJS from returning a 304
- Fixed issue where prerender-status-code set to
200
was causing the page to skip being cached - Fixed an issue where we weren't using the correct pid when trying to force kill PhantomJS.
- Moved clearing of memory cache and local storage to before the page loads instead of after. This will prevent edge cases that could cause a 304.
- Fixed issue where S3HtmlCache was calling next() before finishing saving to the cache
- Fixed issue where we were calling
hasOwnProperty
on aquerystring
that no longer had Object on it's prototype chain
- Fixed issue where a webpage calling window.close would cause Prerender to be unable to shutdown PhantomJS properly
- S3 cache plugin was incorrectly saving non-200 status code responses to the cache
- preserve phantom arguments when server is restarting
- use default when phantomArguments is empty
- prevent multiple phantomjs instances from being started with low number of iterations
- try to check to see if phantomjs has actually been disposed. if not, force kill it.
- added engines to package.json and fixed possible bug in checking options passed in
- prevent weird hangup on error setting a header with a newline
- make sure we catch any errors thrown from phridge and continue
- kill workers (and phantomjs) on SIGTERM
- Changed
PHANTOM_CLUSTER_NUM_WORKERS
toPRERENDER_NUM_WORKERS
in server.js - Changed
PHANTOM_WORKER_ITERATIONS
toPRERENDER_NUM_ITERATIONS
in server.js - Switched from
phantomjs-node
bridge tophridge
- All Prerender plugins that access PhantomJS need to be rewritten to support new phridge integration. For example, change this:
req.prerender.page.set('onConsoleMessage', function(msg) {
console.log(msg);
});
to this:
req.prerender.page.run(function() {
this.onConsoleMessage = function(msg) {
console.log(msg);
};
});
Please see phridge for more info on how to interact with PhantomJS through phridge
.
###Removed
- Removed
PHANTOM_CLUSTER_BASE_PORT
sincephridge
doesn't start a webserve to talk to PhantomJS, so it's no longer needed. - Removed
PHANTOM_CLUSTER_MESSAGE_TIMEOUT
sincephridge
doesn't start a webserve to talk to PhantomJS, so it's no longer needed.