Skip to content

Using Prismic Preview mode

Peter Jaap Blaakmeer edited this page Feb 3, 2023 · 2 revisions

Using Prismic Preview Mode

Configure the Settings > Previews section in Prismic and set the preview route to /prismicio/preview, like this:

image

You can add multiple preview routes, so you can add your local & staging environments as well and choose one environment when starting Preview Mode:

image

Using Preview with Varnish on production

Add the following to your .vcl file in sub vcl_recv {} to use Prismic Preview with Varnish;

    if (req.http.Cookie ~ "io.prismic.preview") {
        return (pass);
    }

This will bypass Varnish caching when the preview cookie has been set. Note; this causes Magento to skip Varnish for the remainder of the browsing session for ALL pages (not just the preview pages).