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

Cache is not automatically cleared when widgets are changed #411

Closed
3 tasks done
raamdev opened this issue Feb 6, 2015 · 10 comments
Closed
3 tasks done

Cache is not automatically cleared when widgets are changed #411

raamdev opened this issue Feb 6, 2015 · 10 comments

Comments

@raamdev
Copy link
Contributor

raamdev commented Feb 6, 2015

Steps to reproduce this bug

  1. Install and activate Quick Cache (tested with v150129) leaving the deafult settings
  2. Make sure at least one widget is being used (Dashboard → Appearance → Widgets)
  3. Logout and visit the site to cache a page where the widget appears (so that the widget content is cached)
  4. Now log back into the Dashboard and change (edit, delete, add) a widget that you know has been cached

Expected Behavior

The entire cache should be cleared, since a change to widgets may affect many pages on the site.

Observed Behavior

No cache files are cleared. The old cache file continues to be presented to users and the changes to widgets are not seen until the cache is cleared manually.


Support threads referencing this issue


What Needs to Happen Here?

  • We need to attach to at least one new hook/filter in WordPress. I'm referencing this filter that we could attach to in order to automatically clear the cache whenever any widget is updated or removed.
  • We need to look at the difference between "removing" a widget and "deleting" a widget, and then see if the filter I mentioned will cover both cases. I think that it will not.
  • Determine next actions.
@rudrastays
Copy link

Hi,
Sorry for a late response. Ok so this indeed is a bug. I am not well versed with the programming/coding stuff. So I will be of little help. At the same time, I am sure we will have an updated patch addressing this minor issue soon...

@raamdev
Copy link
Contributor Author

raamdev commented Feb 10, 2015

@rudrastays No worries on the late response. :-) If you'd like to help us test the fix when it's ready, I suggest joining the beta mailing list so that you are notified when the beta version is available to test: please sign-up to be a beta tester here.

@jaswrks
Copy link

jaswrks commented Mar 20, 2015

Referencing this filter that we could attach to in order to automatically clear the cache whenever any widget is updated or removed.

@raamdev raamdev added this to the Next Release milestone Mar 22, 2015
@raamdev
Copy link
Contributor Author

raamdev commented Mar 22, 2015

@jaswsinc Thank you. I'm adding this to the Next Release milestone.

@jaswrks
Copy link

jaswrks commented Mar 26, 2015

I'm adding a list of things (↑ above) that need to occur.

@raamdev raamdev modified the milestones: Next Release, Future Release Apr 10, 2015
@raamdev raamdev modified the milestones: Next Release, Future Release Jun 5, 2015
@raamdev raamdev modified the milestones: Next Release (Pro), Future Release Jul 10, 2015
@raamdev raamdev modified the milestones: Next Release (Lite), Future Release (Lite) Sep 30, 2015
@raamdev raamdev modified the milestones: v151107 (Lite), Future Release (Lite) Nov 7, 2015
@raamdev raamdev modified the milestones: Future Release, Next Release May 11, 2016
@raamdev raamdev modified the milestones: Next Release, Future Release Jun 20, 2016
@raamdev
Copy link
Contributor Author

raamdev commented Aug 24, 2016

@jaswsinc writes...

Referencing this filter that we could attach to in order to automatically clear the cache whenever any widget is updated or removed.

It looks like you didn't reference a tagged version of that file, so the link is broken now. Were you referring to wp_unregister_sidebar_widget?

@jaswrks
Copy link

jaswrks commented Aug 30, 2016

Yes, and there are two:

Note: Both untested; i.e., I've never attached to either of these before.

@raamdev raamdev modified the milestones: Next Release, Future Release Sep 6, 2016
@raamdev raamdev modified the milestones: Next Release, Future Release Oct 11, 2016
jaswrks pushed a commit to wpsharks/comet-cache-pro that referenced this issue Dec 8, 2016
jaswrks pushed a commit to wpsharks/comet-cache-pro that referenced this issue Dec 8, 2016
…arance → Widgets** are added/edited/removed, and Comet Cache will automatically clear the cache so that your site remains up-to-date. See [Issue #411](wpsharks/comet-cache#411).
@jaswrks
Copy link

jaswrks commented Dec 8, 2016

Noting that the two hooks I referenced prior did not work out at all. Instead, I attached to update_option_sidebars_widgets via update_option(), which works great in my tests.

@renzms
Copy link

renzms commented Dec 15, 2016

@raamdev @jaswsinc

Confirmed Working

Tested by removing, deleting, and updating/saving widgets and cache is cleared. A new cache is generated upon visiting the page where the widget was.

Before:


screen shot 2016-12-15 at 12 35 54 pm

After:


screen shot 2016-12-15 at 12 36 50 pm

raamdev added a commit that referenced this issue Dec 21, 2016
- **Bug Fix:** Improving PHP OPcache detection. Now considering the INI option `opcache.restrict_api`. Comet Cache is now smart enough to avoid generating the PHP Warning: _PHP Warning: Zend OPcache API is restricted by "restrict_api" configuration directive_. See [Issue #733](#733).
- **New Feature (Pro): Mobile Mode.** This release adds a new feature that is designed to improve compatibility with Adaptive themes for mobile devices. To learn more, please see: **Dashboard → Comet Cache Pro → Plugin Options → Mobile Mode**. See also: [Issue #471](#471).
- **Enhancement: Auto-Clearing Author Page Cache.** This release makes Comet Cache smart enough to detect when a user is deleted (or removed from a child blog in a Network), at which time the Author page for that user will be cleared from the cache so it can be regenerated automatically. See [Issue #304](#304).
- **Enhancement: Multibyte Compatibility.** This release improves support for WordPress Permalinks that contain UTF-8 symbols (or emojis) in them. More specifically, this release adds the `/u` flag to all `preg_*()` calls in cache clearing routines that generate cache paths from Watered-Down Regex patterns entered by a site owner. See: [Issue #611](#611).
- **Enhancement: Widget Change Detection.** Comet Cache can now detect when **Appearance → Widgets** are added/edited/removed, and Comet Cache will automatically clear the cache so that your site remains up-to-date. See [Issue #411](#411).
- **Enhancement (Pro): Static CDN Filters and `srcset`.** This release enhances Static CDN Filters in Comet Cache Pro. Static CDN Filters are now smart enough to filter all image sources included in an `srcset=""` attribute that is generated by WordPress. See [Issue #660](#660). If you'd like to learn more about `srcset=""`, see [this article at WordPress.org](https://make.wordpress.org/core/2015/11/10/responsive-images-in-wordpress-4-4/).
- **Enhancement (Pro): Automatic Background Updates.** It is now possible to enable automatic background updates that occur quietly in the background whenever new features, bug fixes, or security issues are addressed by our developers. See: **Dashboard → Comet Cache Pro → Config. Options → Update Credentials**. See also: [Issue #827](#827).
- **Enhancement (Pro): HTML Compressor + Accelerated Mobile Pages (AMP).** Updated to the latest available release of the HTML Compressor (v161208) with improved support for [Accelerated Mobile Pages](https://www.ampproject.org/). See: [Issue #695](#695). See also: [HTML Compressor v161208 changelog](https://github.com/websharks/html-compressor/releases/tag/161208).
- **Enhancement (Pro): HTML Compressor / AMP Compatibility.** Improved compatibility with [Accelerated Mobile Pages](https://www.ampproject.org/). There is a new HTML Compressor option that is enabled by default and it makes Comet Cache smart enough to auto-detect and selectively disable portions of the HTML Compressor that are incompatible with the AMP spec; i.e., routines that are not necessary when serving APMd pages. In short, if the URI being compressed ends with `/amp/`, or the document contains a top-level `<html ⚡>` tag (`<html amp>` is accepted as well), then features which are incompatible with [Accelerated Mobile Pages](https://www.ampproject.org/) will be disabled accordingly.
- **Compatibility:** Avoid deprecated `wp_get_sites()` and use `get_sites()` instead. See [Issue #848](#848).
- **Documentation:** Added Watered-Down Regex documentation notes to the inline documentation (in the software) about the use of `^` and `$` in some places where these special characters are not fully supported. Also adding the same notes to the [Watered-Down Regex KB Article](https://cometcache.com/r/watered-down-regex-syntax/). See also: [Issue #611](#611).
@raamdev
Copy link
Contributor Author

raamdev commented Dec 21, 2016

Comet Cache v161221 has been released and includes changes from this GitHub Issue. See the v161221 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 (#411).

@raamdev raamdev closed this as completed Dec 21, 2016
@wpsharks wpsharks locked and limited conversation to collaborators Dec 21, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants