Posted in Site Development
160
12:47 am, December 23, 2020
 

Google Page Speed Cleanup and Testing

<p>Here we go with some google page speed testing, on the new reduced size kruxor.com</p>
<p>Its less impressive than i thought it would be:</p>
<p><a href="https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fkruxor.com%2F" target="blank" rel="noopener">https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fkruxor.com%2F</a>&nbsp;</p>
<p><img src="https://i.imgur.com/I89lASX.png" /></p>
<p><img src="https://i.imgur.com/DwMQKZa.png" /></p>
<p>But we can fix it!</p>
<h2>TinyMCE</h2>
<p>So tiny mce was included for every page load, even thought most pages had no use for it. So i have changed this to only load the script when a user is logged into the site.</p>
<p>Here are the change details:&nbsp;<a href="https://kruxor.com/view/code/06BMq/include-tinymce-only-if-a-user-is-logged-into-the-site/">Include tinymce only if a user is logged into the site</a>.</p>
<p>Lets do another test without that script and see how the score has improved.&nbsp;</p>
<p><img src="https://i.imgur.com/0JroBQS.png" /></p>
<p>OK now we are up to 90, on desktop. Lets not look at the mobile one yet as its pretty bad.&nbsp;</p>
<p>So removal of TinyMCE gives us 3 extra points.&nbsp;</p>
<p><strong>CSS Minify and inline</strong></p>
<p>Instead of loading external files, its pretty easy to just load them and then inject them into the header, which reduces the amount of file requests per site.&nbsp;</p>
<p>While i was testing i just included the file but now that its pretty good, i think i can minimise it on the fly and inject it with the other styles.&nbsp;</p>
<p><code>$css
styles .= $functions-&gt;minify(filegetcontents("css/grid.css"));</code></p>
<p>And now we are up to 95 on desktop.</p>
<p><img src="https://i.imgur.com/Yr4wEXD.png" /></p>
<p>Mobile is still a bit low.</p>

View Statistics
This Week
125
This Month
429
This Year
209

No Items Found.

Add Comment
Type in a Nick Name here
 
Search Articles
Search Articles by entering your search text above.
Welcome

This is my test area for webdev. I keep a collection of code here, mostly for my reference. Also if i find a good link, i usually add it here and then forget about it. more...

You could also follow me on twitter. I have a couple of youtube channels if you want to see some video related content. RuneScape 3, Minecraft and also a coding channel here Web Dev.

If you found something useful or like my work, you can buy me a coffee here. Mmm Coffee. ☕

❤️👩‍💻🎮

🪦 2000 - 16 Oct 2022 - Boots
Random Quote


Latest News
## 🚀 AI Giants Hit Bullseye: Anthropic & OpenAI Achieve Product-Market Fit Anthropic and OpenAI have reached a significant milestone, finding product-market fit with their AI technologies, which means their products effectively meet the needs of their customers, driving growth and adoption. This achievement showcases the practical value of their innovations, enabling businesses and individuals to leverage AI for enhanced productivity and efficiency. With this alignment of product and market needs, these companies are poised to transform industries and shape the future of technology.