Comparing version 1.6.2 to 1.6.3
{ | ||
"name": "nodesi", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "ESI: the good parts in node.js", | ||
@@ -5,0 +5,0 @@ "main": "esi.js", |
@@ -9,2 +9,19 @@ [![Build Status](https://travis-ci.org/Schibsted-Tech-Polska/nodesi.svg?branch=master)](https://travis-ci.org/Schibsted-Tech-Polska/nodesi) | ||
## What problem does it solve? | ||
Let's say you want to use ESI in your project, but also want to retain good developer experience. | ||
Rather than having to configure [Varnish](https://varnish-cache.org/docs/3.0/tutorial/esi.html) or [Ngnix](https://www.nginx.com/blog/benefits-of-microcaching-nginx/) to take care of server-rendered ESI tags locally you can simply pass the server output through `esi.process` function right before pushing it out to the client. | ||
```javascript | ||
var response = obtainServerResponseWithEsiTags(); | ||
return Promise.resolve() | ||
.then(function() { | ||
if(process.env.NODE_ENV !== 'production') { | ||
return esi.process(response); | ||
} | ||
return response; | ||
}); | ||
``` | ||
It also improves code mobility - if for whatever reason you decide to move from ESI-enabled environment into one that doesn't support it (yet?), all you have to do is to process the response directly on the server. This module should be performant enough for that use case. | ||
## Features | ||
@@ -11,0 +28,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15601
170
1