New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live Preview doesn't reflect changes when static cache enabled and page is published #1636

Closed
jsblair9 opened this Issue Oct 26, 2017 · 7 comments

Comments

Projects
None yet
4 participants
@jsblair9

jsblair9 commented Oct 26, 2017

Expected behaviour

When editing a page in the CP, the Live Preview should always function even if any sort (half or full measure) caching is enabled, and the page is published.

Actual behaviour

When static caching is enabled, and the page is published -- while editing a page in the CP, when a change to the content is made the live preview does not reflect it. I can however tell that live preview frame flashes indicating a reload, but the content remains the same.

  • Live preview does function correctly when static caching is disabled.
  • Live preview does function correctly when the static caching is enabled, and the page is not published (draft mode).

I did attempt to add /cp/pages/edit* to the excluded URLs list but had no affect

Steps to reproduce

  1. Enable static page caching
  2. Edit a page/post and attempt to Live Preview
  3. Edit content to initiate a live preview reload
  4. Toggle the published status to draft and save
  5. Using live publish should now work as expected
  6. Toggle the published status to active -- live preview doesn't update on change

Server Details

Operating System: Linux

Web Server: NGINX

PHP Version: 7.0

Statamic Version: 2.7.1

Updated from an older Statamic or fresh install: Updated

List of installed addons: (happy to provide if needed, but most are custom so naming them here might not really help all that much)

Logs

nothing from the logs to share...

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Nov 1, 2017

This should be a fun one to solve! Never really even thought about live preview + caching.

@FrittenKeeZ

This comment has been minimized.

FrittenKeeZ commented Feb 2, 2018

I haven't looked at how Live Preview functions, but could it be an idea to have the live pages fetched through //mydomain.com/_live/<page-id> with their state stored in a temp cache?

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Feb 2, 2018

We POST to the real URL and it changes the data. Haven't quite worked out how to handle it with caching.

@FrittenKeeZ

This comment has been minimized.

FrittenKeeZ commented Feb 2, 2018

What about posting to /_live/<real_url> and have it return the same outcome? :)

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Feb 5, 2018

I don't know if I want to change how Live Preview works in v2 but I will definitely look into it for v3.

@dannyuk1982

This comment has been minimized.

dannyuk1982 commented Mar 15, 2018

As a short term fix, the live preview button could be hidden when static caching is on

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Mar 15, 2018

Button hidden for next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment