Extension PortalJS Improvements


Extension Basics

Title
PortalJS Improvements
Name
ckanext-portaljs-improvements
Type
Public extension
Description
Allows the use of On demand Incremental Static Regeneration (ISR) on Portal.JS websites, making CKAN backend aware of PortalJS frontend for automatic page updates.
CKAN versions
Download-Url (zip)
Last commit
2 years ago (2023-07-14 16:30:14)
Url to repo
Category
Content Management


Background Infos

Description (long)
Show details

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

  1. Activate your CKAN virtual environment.
  2. 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
    
  3. Add portaljs_improvements to the ckan.plugins setting in your CKAN config file.

  4. Restart CKAN.

Config settings

None at present.

License

AGPL-3.0

Version
0.0.1
Version release date
2022-09-09
Contact name
Luccas Mateus
Contakt email
Contact Url
(not set)


Installation Guide

Configuration hints

Add ‘portaljs_improvements’ to ckan.plugins. Requires a PortalJS frontend configured for On demand ISR.

Plugins to configure (ckan.ini)
portaljs_improvements
CKAN Settings (ckan.ini)
# No specific environment variables documented
DB migration to be executed
(not set)
<< back to Extensions