Skip to content

Also run Init in production #36

@mdings

Description

@mdings

Is it correct that the exported Init function for pages only runs in develop mode? In production it seems that the data is being loaded from the cached json-file.

Although a nice feature, I'm running into cases where I need the latest data from the server to be fetched and hydrate any content from cache. For example: I have a website where pages can be created inside a CMS. When building the website all the pages are pre-rendered and cached, which is amazing. However, whenever I make a small change inside the content for the page I would need to rerender the full website in order for that change to be visible. With the previous version the Init function would also still run in production mode. So the browser renders the static version from the server. Then the Init-function fetches the latest version from the server and goes ahead and updates the content that was changed. So I get the lastest version no matter what.

Is that still possible with the current version of hyperstatic?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions