Skip to content

Custom live preview debounce value #1430

@SanderFlooris

Description

@SanderFlooris

Why?

We use Statamic (v5.69.0) as a headless CMS and do the rendering of pages via another application.
It can take some time to execute the render however, so we would like to customize the debounce of the live preview.

I looked into the source code of Statamic and it seems like this value is hardcoded at 150ms, which is pretty extreme for our application. For context, it takes Statamic a couple of seconds to send us the live preview data for complicated pages and then takes our application about 0.5 second to render it all.

It would be nice if this value could be customized, so we can slow down the amount of requests we get and thus decrease server load.

Preferred solution

Maybe add a debounce_time configuration value to the live_preview.php configuration file?

Relevant code

Image

https://github.com/statamic/cms/blob/7f50c95ba77a4c3011a57cbfbe9e6af6c6768bba/resources/js/components/live-preview/LivePreview.vue#L269

Related issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions