Hi, I have performed some speed optimisation on my site https://magicwedding.co.uk and noticed that everything loads fine if I refresh the page once after its loaded. What I would like to do is add some code to do this.
I found the following online, which states it needs to be added into the header.php:
(function()
{
if( window.localStorage )
{
if( !localStorage.getItem( 'firstLoad' ) )
{
localStorage[ 'firstLoad' ] = true;
window.location.reload();
}
else
localStorage.removeItem( 'firstLoad' );
}
})();
</script>
My question is how do I add this the the header.php file? Thanks