5.x Performance Boost w/code

Derek1244

New Member
YetiShare User
YetiShare Supporter
Jul 17, 2020
11
3
3
UPDATED 5/2:

Recently spent some time try looking at ways to improve page load time. Identified an easy win that cuts the page load time in half for files that are shared (Unlogged In Visitors). Since visitors viewing a shared file dont have the ability to upload (Without Modification) it makes no sense to load uploader.js which takes a while to generate. The original code I posted was incomplete and prevented unauthenticated users from downloading files, with the additional change below it now works and you get the speed boost.

Code:
sudo vi /var/www/html/themes/spirit/views/account/partial/layout_logged_in.html.twig
(Line 94 on Version 5.3.1)

        {% if Auth.loggedIn() == 'true' %}
        <script type="text/javascript" src="{{ CORE_SITE_PATH }}/assets/js/uploader.js?r={{ date().timestamp }}"></script>
        {% endif %};

(Line 113 on Version 5.3.1)
{% if Auth.loggedIn() == 'true' %}{% else %}var uploadComplete = true;{% endif %}
 
Last edited: