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 with static caching enabled #2153

Closed
FrittenKeeZ opened this Issue Aug 31, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@FrittenKeeZ

FrittenKeeZ commented Aug 31, 2018

Seemingly this should work with sample.htaccess but sample.nginx.conf doesn't have a check for request method being GET only.

This should resolve the issue for nginx, so live preview once again can be enabled for static caching.

# Dynamically detect request of static cached pages.
set $dynamic_location @default;
if ($request_method = GET) {
    set $dynamic_location @static;
}
location / {
    try_files $uri $dynamic_location;
}
location @static {
    try_files /static${uri}_${query_string}.html @default;
}
location @default {
    try_files $uri $uri/ /index.php?$query_string;
}

@FrittenKeeZ FrittenKeeZ changed the title from Live Preview with static caching enabled to WIP: Live Preview with static caching enabled Aug 31, 2018

@FrittenKeeZ FrittenKeeZ changed the title from WIP: Live Preview with static caching enabled to Live Preview with static caching enabled Sep 3, 2018

@FrittenKeeZ

This comment has been minimized.

FrittenKeeZ commented Sep 3, 2018

To test it out locally and force live preview back on with static caching enabled, set 'staticCachingEnabled': false, in statamic/resources/views/partials/head.blade.php and enable static caching in site/settings/caching.yaml:

static_caching_enabled: true
static_caching_type: file
@philipboomy

This comment has been minimized.

philipboomy commented Sep 3, 2018

I have tested this and I can confirm it works for me.

@FrittenKeeZ

This comment has been minimized.

FrittenKeeZ commented Oct 15, 2018

@jackmcdade @jasonvarga have you had any time to test this?

@bgarrant

This comment has been minimized.

bgarrant commented Oct 15, 2018

It would be great to get Live Preview and caching working together. It makes flat file benefits minimal without the caching on. Clients love the Live Preview so it should be usable all the time.

@bgarrant

This comment has been minimized.

bgarrant commented Oct 15, 2018

@jackmcdade @jasonvarga Is there any way to get this working in V2? If not in V2 how about V3?

@jasonvarga

This comment has been minimized.

Member

jasonvarga commented Oct 18, 2018

Released in 2.10.7

@jasonvarga jasonvarga closed this Oct 18, 2018

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