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

EZP-14306 Refresh eZExpiryHandler instance after change siteaccess. #1240

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Opencontent
Copy link
Contributor

This pull requeste is needed in multisite-multidb installations.
We don't want to expire the cache of all instances when we need to expire the cache just of a single instance.
With this patch the expiry values are stored in each var dir rather than globally.

@Opencontent Opencontent changed the title Refresh eZExpiryHandler instance after change siteaccess. EZP-14306 Refresh eZExpiryHandler instance after change siteaccess. Mar 3, 2016
{
unset( $GLOBALS['eZExpiryHandlerInstance'] );
}
return self::instance();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it return an instance ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't usefull?

@bdunogier
Copy link
Member

Thank you for your contribution.

With this patch the expiry values are stored in each var dir rather than globally.

I don't really understand where this change is done, to be honest.

@Opencontent
Copy link
Contributor Author

@bdunogier yes my comment is a bit cryptic :)
You need to properly configure the site.ini FileSettings VarDir (it is assumed that each "group" of site access shares the same var dir).
If your site.ini/FileSettings/CacheDir settings is relative, the expiry.php file will be stored in VarDir/CacheDir, one per "group" of siteaccess.
The handler set the "right" path of CacheFile in https://github.com/ezsystems/ezpublish-legacy/blob/master/kernel/private/classes/ezpkernelweb.php#L259

@Opencontent
Copy link
Contributor Author

To further explain the issue: in a multisite (multidatabase) environment what happens is that, when an editor of website A clears the cache, the system writes the global expiry.php. That "invalidates" the cache for website B, C, D and so on, issuing a massive cache regeneration.
The patch basically sets an expiry.php for each website.
Hope it is clearer now.

@gggeek
Copy link
Contributor

gggeek commented Mar 4, 2016

@Opencontent but are there any caches which are in fact supposed to be cleared across all sites, which do not get cleared any more because of your change? (sorry, did not look at the code, only thinking about the description)

@crevillo
Copy link
Contributor

crevillo commented Mar 4, 2016

i have to agree with @gggeek . at least this should be configured somehow. Maybe someone wants indeed clear all of the sites cache. i can think in, at least, one our multisites projects needing this...

@francescor
Copy link

Yes, sure there are caches that needs to be cleared across all sites, but this operation should be triggered by the developer (& not done that often), shouldn't be? : a great advantage (hard disk performance-wise, especially) is sure gained if editors of site A cannot clear cache of site B.

@Opencontent
Copy link
Contributor Author

That's right @gggeek @crevillo
Added a site.ini setting to control the behavior and removed the return statement

Opencontent added a commit to OpencontentCoop/ezpublish that referenced this pull request Oct 30, 2024
…red in each var dir rather than globally.

Useful in multisite-multidb installations.
See ezsystems/ezpublish-legacy#1240
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants