Tagged: cache, compression, CSS, Minification, styles
-
AuthorPosts
-
July 14, 2019 at 12:37 pm #1118482
Dear Support Team,
first I would like to thank you for your great product, I am very satisfied with the enfold theme.
Nevertheless I have to give feedback on a problematic situation / missing feature.
System:
– Browser FF 68 on Win 10
– WP 5.1
– Enfold Child Theme 4.5.4Steps to Reproduce:
1. Enable CSS minification and compression (CSS-Datei-Zusammenführung und -Komprimierung) in performance settings
2. Call any Frontend Page
3. Inspect merged styles URL which is /uploads/dynamic_avia/avia-merged-styles-f8bde59cd070bb823885cbbda4d43f93.css
4. Disable CSS minification and compression
5. Make changes in my enfold-child/style.css
6. Enable CSS minification and compression
7. Inspect merged styles URL which is still /uploads/dynamic_avia/avia-merged-styles-f8bde59cd070bb823885cbbda4d43f93.cssThe problem is:
– The hash of the merged styles stays unchanged which causes browser cache issues for the website visitors, they will not see the new css styles unless the browser cache expires
Feature Request:
– Change the merged styles CSS hash whenever the styles have been changed. That gives developers the possibility to circumvent the end users browser cache. Or add a feature to append somekind of timestamp / custom version number.
Thanks a lot Philipp
July 14, 2019 at 9:53 pm #1118581Hey philipp1979,
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.
- Install and activate ” Temporary Login Without Password “.
- Go to ” Users > Temporary Logins ” on the left-side menu.
- Click ” Create New “.
- Add the email address for the account ( you can use (Email address hidden if logged out) ), as well as the ” Role ” making that the highest possible and the expiry about four days
( do be sure that we have enough time to debug ). - Click ” Submit “.
- You’ll now have a temporary account. Please provide us here in the private section the URL, so we can login and help you out.
When your issue is fixed, you can always remove the plugin!
If you prefer to not use the plugin, you can manually create an admin user and post the login credentials in the “private data” field.Best regards,
BasilisJuly 27, 2019 at 11:26 pm #1122451Thanks Basilis for your response, but i think this is not a bug, so there is no need to give you access to my website. When I have a look at your code, it seems, the hash is generated like this:
Inside /themes/enfold/config-templatebuilder/avia-template-builder/php/asset-manager.class.php
$data['hash'] .= $file; ..... $data['hash'] = $file_group_name .'-'. md5( $data['hash'] . $data['version'] );
So the hash will always stay the same.
Thanks
July 30, 2019 at 12:52 am #1122987Hi,
Thank you for the update.
We will forward this to the dev team. For now, you have to manually delete the merged stylesheet whenever you make any significant changes to the style. Or just disable the compression until you’re done with the style configuration. You can also adjust the expiry of the css stylesheets in the .htaccess file.
Best regards,
IsmaelNovember 22, 2019 at 12:26 pm #1159093Hi Ismael, do you have any updates on this issue? Deleting/regenerating the merged styles is no solution as the regenerated file will have the same filename again.
This issue means that any changes made to my custom styles on the production server will not be visible to the end user immediately. They will only see the changes after the cache expires, which is usually 1 month.
So this is actually a very important issue which should be solved with high priority.Thank you
November 25, 2019 at 2:47 am #1159743Hi,
Thank you for the update.
For some reason, I can’t find this issue in our channel. It’s either closed or I forgot to report it. Sorry about that. I will report the issue again now. Temporarily, you can add this filter in the functions.php file to append the current time stamp in the hash string so that the file name changes every time the merged scripts and stylesheets are regenerated.
function avf_asset_mgr_get_file_data_mod($data, $enqueued_index, $file_type, $file_group_name, $enqueued, $conditions) { $data['hash'] .= time(); return $data; } add_filter('avf_asset_mgr_get_file_data', 'avf_asset_mgr_get_file_data_mod', 10, 6);
UPDATE: We reported the issue in our channel. We’ll notify you as soon as possible.
Best regards,
IsmaelNovember 26, 2019 at 6:36 pm #1160423Hi,
Thank you for reporting this.
Solution Ismael provided will not work.
Please update config-templatebuilder/avia-template-builder/php/asset-manager.class.php with
The fix will add a unique timestamp to the merged files when theme options are safed.
Will be part of the next update.
Do not forget to clear server cache. If you need help with the update let us know.
Best regards,
GünterNovember 26, 2019 at 6:44 pm #1160428Hi, thanks for the fix. Will wait for the next Enfold Update. Best regards, Philipp
November 27, 2019 at 2:23 am #1160538Hey!
Alright! @guenter was right. The filter above forces the theme to generate the merged files every page load. For now, you can either modify the file or wait for the next theme update. We’ll close the thread for now. Please don’t hesitate to open a new thread if you need anything else.
Have a nice day.
Cheers!
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.