User tests: Successful: Unsuccessful:
Pull Request for Issue #21943 .
Adds the opcache_invalidate function before loading the configuration file.
opcache_invalidate : invalidates the cached file if the modification time of the file is newer than the cached opcodes.
OR
Create a site on your localhost with these server settings.
Edit the php.ini file and set the opcache.revalidate_freq value to 60 in the opcache section :
[opcache]
zend_extension=php_opcache.dll
opcache.enable=1
opcache.enable_cli=0
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
This is my default configuration (bitnami wappstack server).
Restart Apache service.
The settings in Global configuration are saved and taken into account.
The new global configuration is not taken into account each time I save it (if patch is not applied).
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Also here please fill out the template so we know hwy you do this and how to test and please fix the phpcs issue reported on drone:
FILE: /drone/src/github.com/joomla/joomla-cms/libraries/src/Factory.php
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
572 | ERROR | Please start your comment with a capital letter; found "//
| | opcode cache busting before including the filename"
--------------------------------------------------------------------------------
UPGRADE TO PHP_CODESNIFFER 2.0 TO FIX ERRORS AUTOMATICALLY
--------------------------------------------------------------------------------
As well as add a clean line before the actual include.
Labels |
Added:
?
|
This in effect cache busts the file every time the configuration is loaded (so on every request). Seems like the cache bust should happen when the global config is saved.
Did you miss this comment ? by @mbabker
The cache clearing is called on every request
J3.9 triggers events for Global configuration save (before and after)
onApplicationBeforeSave
onApplicationAfterSave
So against the branch 3.9-dev branch
you could test / try using the code that you have already suggested here,
it should go in some always enabled plugin ... (which one ?)
/**
* On Saving application configuration logging method
* Method is called when the application config is being saved
*
* @param JRegistry $config JRegistry object with the new config
*
* @return void
*
* @since 3.9.0
*/
public function onApplicationAfterSave($config)
{
if (function_exists('opcache_invalidate'))
{
opcache_invalidate(............................);
}
}
The code should go in com_config
model, after the file has been written:
joomla-cms/administrator/components/com_config/model/application.php
Lines 457 to 460 in 54de782
When I change and save global configuration, configuration file is correctly modified (it contains the new editor), but the configuration file was not reloaded with the new configuration (cache was not updated).
opcache_invalidate : invalidates the cached file if the modification time of the file is newer than the cached opcodes.
Category | Libraries | ⇒ | Administration com_config Libraries |
Category | Libraries Administration com_config | ⇒ | Administration com_config |
I have tested this item
Please, could anyone else test this, I need this fix.
https://docs.joomla.org/Testing_Joomla!_patches/en#Recording_test_results
I suggest updating testing instructions to indicate that this can be reproduced when opcache.revalidate_freq
is set to a higher value than the default.
I suggest updating testing instructions to indicate that this can be reproduced when
opcache.revalidate_freq
is set to a higher value than the default.
In my php.ini file, opcache.revalidate_freq
is set to 60 by default.
I have updated testing instructions, as you suggest.
Title |
|
Cloud access.net server has now the same cached behavior.
You have the same issue (configuration saving) when you launch your Joomla! site :
https://launch.joomla.org/
I have tested this item
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-11-17 17:31:12 |
Closed_By | ⇒ | mbabker | |
Labels |
Added:
?
|
Hi, I'm using native Joomla caching and JCH Optimize Pro plugin which minimize the javascript and html files. I will deactivate it and see if there will be some changes.
This in effect cache busts the file every time the configuration is loaded (so on every request). Seems like the cache bust should happen when the global config is saved.