ckanext-portaljs-improvements
This extension has one purpose, to allow the use of On demand Incremental Static Regeneration (On demand ISR) on Portal.JS websites.
NextJS has three ways of fetching data: client fetching, ServerSideRendering and StaticSite Generation (SSG).
- Client fetching allows us to send the skeleton of the page quickly, and then populate it with information using javascript. That has a lot of problems: the SEO gets considerably affected, there is also the problem of layout shifting, and the browsers can’t cache the pages easily.
- Serverside rendering has the advantages of SEO, no layout shifting and easier caching, but we need to wait for all the data to be fetched to show something on the screen.
- StaticSite Generation builds pages ahead of time, fetches all the data, injects that data into the html. This makes page loads super fast. But pages are only built once during deploy.
On demand ISR solves these problems. The data source informs the frontend that data has been updated, then the frontend rebuilds only the affected pages. This extension makes the CKAN backend aware of the existence of a PortalJS website, so after every update/create process, the corresponding pages get updated.
Requirements
| CKAN version |
Compatible? |
| 2.6 and earlier |
not tested |
| 2.7 |
not tested |
| 2.8 |
not tested |
| 2.9 |
yes |
Installation
- Activate your CKAN virtual environment.
Clone the source and install:
git clone https://github.com/datopian/ckanext-portaljs-improvements.git
cd ckanext-portaljs-improvements
pip install -e .
pip install -r requirements.txt
Add portaljs_improvements to the ckan.plugins setting in your CKAN config file.
Restart CKAN.
Config settings
None at present.
License
AGPL-3.0