Add a option to immediately load delayed script for Repeated Visits
-
Add a option to enable or disable delay load script to load immediately. For example, if user visits the site for the first time, then use interaction, or Max seconds to automatically load script. Then on repeated visits by the same user, make scripts loading immediately.
Currently I modified the plugin file delay-load.php :
$js = sprintf( ‘<script>var debloatConfig = %1$s;</script>%2$s’, json_encode($configs), $js );
to
$js = sprintf( ‘<script>var debloatConfigStr=localStorage.getItem(\’debloatConfig\’);var debloatConfig=debloatConfigStr?JSON.parse(debloatConfigStr):{“cssDelayType”:”interact”,”jsDelayType”:”interact”,”jsDelayMax”:””};if(debloatConfigStr){debloatConfig.jsDelayMax=”1″}localStorage.setItem(\’debloatConfig\’,JSON.stringify(debloatConfig));</script>%2$s’, json_encode($configs), $js );
Hope this option added in future version ??. In this way, Page speed score will always 90+, while maintaining better UX for further navigation.
- The topic ‘Add a option to immediately load delayed script for Repeated Visits’ is closed to new replies.