Skip to content
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

Disable caching for previews #583

Closed
clavaque opened this issue Oct 3, 2015 · 10 comments
Closed

Disable caching for previews #583

clavaque opened this issue Oct 3, 2015 · 10 comments
Assignees
Labels
bug
Milestone

Comments

@clavaque
Copy link

@clavaque clavaque commented Oct 3, 2015

While editing a page I noticed that the changes I was making were not shown in the preview, until I cleared the cache.

I think that not caching the preview is the logical thing, you'll always be expecting it to change with your new edits.

I added preview=true as a URI exclusion, but I think this should be there by default because it'll confuse other site owners that'll need to figure this out too.

@raamdev
Copy link
Contributor

@raamdev raamdev commented Oct 3, 2015

Are you referring to when Logged-In User Caching is enabled?

@clavaque
Copy link
Author

@clavaque clavaque commented Oct 3, 2015

I have it enabled, yes.

@raamdev raamdev added bug and removed needs feedback labels Oct 5, 2015
@raamdev
Copy link
Contributor

@raamdev raamdev commented Oct 5, 2015

@clavaque Thanks! I'm marking this as a bug.

@clavaque
Copy link
Author

@clavaque clavaque commented Oct 5, 2015

ok

@jaswrks
Copy link

@jaswrks jaswrks commented Oct 6, 2015

@clavaque And you have GET Request caching enabled also, right?

@jaswrks
Copy link

@jaswrks jaswrks commented Oct 7, 2015

Next Actions

  • New feature branch: feature/583 in the websharks/zencache-pro repo.

  • After this line add the following:

      if (!empty($_REQUEST['preview'])) {
        return $self->maybeSetDebugInfo(NC_DEBUG_PREVIEW);
    }
  • After this line add the following:

    /**
    * No-cache because it's a preview.
    *
    * @since 15xxxx Adding support for preview detection.
    *
    * @type string A unique string identifier in the set of `NC_DEBUG_` constants.
    */
    const NC_DEBUG_PREVIEW = 'nc_debug_preview';
  • After this line add the following:

    case NC_DEBUG_PREVIEW:
        $reason = __('because `$_REQUEST` indicates this is simply a preview of something to come.', SLUG_TD);
        break; // Break switch handler.
  • Submit PR.

@jaswrks
Copy link

@jaswrks jaswrks commented Oct 7, 2015

@kristineds While working on this issue you can learn more about the switch(){} and case: control structure here: http://php.net/manual/en/control-structures.switch.php

kristineds added a commit to wpsharks/comet-cache-pro that referenced this issue Oct 7, 2015
@raamdev raamdev added this to the Next Release (Pro) milestone Oct 7, 2015
kristineds added a commit to wpsharks/comet-cache-pro that referenced this issue Oct 8, 2015
@raamdev
Copy link
Contributor

@raamdev raamdev commented Oct 10, 2015

Next Pro Release Changelog:

  • Bug Fix: Fixed a bug where post previews were being cached when Logged-In User Caching and GET Request caching were both enabled (both are disabled by default). This release now detects previews in this scenario and excludes those requests from being cached. Props @clavaque @kristineds. See Issue #583.
@raamdev raamdev closed this Oct 10, 2015
@clavaque
Copy link
Author

@clavaque clavaque commented Oct 10, 2015

@jaswsinc

you have GET Request caching enabled also, right?

That's correct.

@raamdev
Copy link
Contributor

@raamdev raamdev commented Nov 14, 2015

ZenCache v151114 has been released and includes changes from this GitHub Issue. See the v151114 announcement for further details.


This issue will now be locked to further updates. If you have something to add related to this GitHub Issue, please open a new GitHub Issue and reference this one (#583).

@wpsharks wpsharks locked and limited conversation to collaborators Nov 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants