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

Description of Caching Types #224

Closed
donnchawp opened this Issue Apr 10, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@donnchawp
Copy link
Contributor

donnchawp commented Apr 10, 2017

I want to change the descriptions and even names of the different caching types to make it easier for new users to understand what settings they should use. At present we have:

  1. mod_rewrite
  2. PHP
  3. Legacy page caching

This exposes the implementation of the caching delivery, not what they're useful for. A technical user might understand the implications of the first two but not the third. Any other user will be lost but at least the settings page recommends PHP mode.

Related to legacy caching is the option "Don’t cache pages for known users." which is recommended. This disables a portion of legacy page caching. That stops caching when logged in users or users who comment visit the site, except for feeds because of this code.

There's also "Don’t cache pages with GET parameters" which disables the other function of legacy caching which is to cache pages that have ?x=y or whatever at the end of the URL.

Explanation:

  1. mod_rewrite mode uses rules in a .htaccess file to serve cached files instead of WordPress loading, hitting the database and taking time. It can be blazingly fast and a server will be able to cope well under load as long as the web server is configured correctly. Writing to the .htaccess file of a live website can be risky but the code that does this has been working fairly reliably for many years now.
  2. PHP mode uses PHP to serve cache files in a similar way. A portion of WordPress is loaded, and since WordPress 4.6 more of the system is loaded but it's still very light on resources. This is recommended because it's simple to get going.
  3. Legacy Caching is the method WP-Cache used to store cached pages. These cache files store information about the headers and are stored as an md5 hash of the url and identifying user information. This means that we can cache pages with personalised content such as name or username. Previously the cache files were stored in one directory. Maintaining them was relatively expensive because garbage collection had to scan all files to find the files related to the current page (for example). The next release of the plugin will store these files in the supercache directories make maintenance simple.

Methods 1 and 2 are used only to store hits from anonymous, unknown users. Legacy caching is always used (except when the options above are selected) to cache files for known users like those that are logged in or leave comments.

With the changes to legacy caching I feel more confident about people using it more. It should be used to cache REST API calls for example.

So what should we call them?

Maybe separate them out to "anonymous users" and "full caching" groups?

One thing to consider is that legacy caching always works anyway unless deliberately disabled so maybe we should only ask the user to choose between the first two caching methods, and offer options to disable caching for known users and the GET parameters..

@marcomarsala

This comment has been minimized.

Copy link

marcomarsala commented May 30, 2017

  1. Full page cache (static)
  2. Full page cache (dynamic)
    I'll remove ability to select 3).
@donnchawp

This comment has been minimized.

Copy link
Contributor

donnchawp commented Jun 8, 2017

"dynamic page caching" is already a function of the plugin (to make static pages with dynamic parts) so we can't use that. In #255 I added code that makes the settings page look like this:

screen shot 2017-06-07 at 17 35 25

Comments should probably continue on that PR.

@donnchawp

This comment has been minimized.

Copy link
Contributor

donnchawp commented Jun 9, 2017

I merged the PR. The settings look like this now:

screen shot 2017-06-08 at 16 58 29

@donnchawp donnchawp closed this Jun 9, 2017

@StaggerLeee

This comment has been minimized.

Copy link

StaggerLeee commented Nov 26, 2017

I am by no means beginner in WP and this with "known users" is a bit confusing. What is an "known User" ?

I noticed it does not (sometimes) serve cached page when User logout. With message:
Page not cached by WP Super Cache. Check your settings page. Not caching requests by known users. (See Advanced Settings page) .

Is it browser cookie dependent ? Confusing.

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