I posted earlier about my attempts to improve my site rendering speed by upgrading my blog server’s RAM. As I noted in that post, it didn’t seem like the changes made much if any difference to the rendering speed in the Safari browser.

After much experimentation, I can hereby clarify/correct all of my previous observations and guesses. The rendering speed problem is not related to my server’s RAM nor is it the fault of the Safari web browser. Instead, my site renders slowly for me because I am logged in as the WordPress administrator for the site.

Boy, do I feel dumb now. Allow me to explain in order to hopefully prevent you from feeling dumb as well.

What I observed

I tried a lot of things over the past 24 hours to improve performance of my site after the less than stellar improvements delivered by upgrading the server memory. Most of this effort centred around various toggles in WP Rocket to minify CSS and change its loading behaviour. But I continued to observe very long delays in Safari during page rendering, upwards of seven seconds before any content appeared, regardless of any changes I made.

I started digging on line to understand rendering differences between Safari and Chrome since it seemed that Chrome (and Firefox) consistently rendered my site much more quickly. I used Safari and Chrome developer tools to observe the page rendering timeline: the delay in Safari seemed to be a single, very long wait for network response on the very first page interaction.

At one point I tried clearing the browser cache several times, which seemed to make no difference. Then I tried using Safari’s ‘private mode’ browser and suddenly my site was loading quickly- consistently and reliably. I imagined all sorts of complex scenarios regarding why this might be the case. Then I clued in on something far simpler: outside of ‘private’ mode I’m normally logged in as a site administrator.

Hypothesis

In ‘private’ mode, the browser blocks access to existing cookies. This effectively prevents the page logic from knowing the user is logged in as administrator, and so the page is rendered without the usual administrator ‘decorations’.

My new hypothesis: something about being logged in as administrator, possibly the generation of the Admin UI bar itself, was drastically slowing down page rendering.

So I went back to Safari’s normal (non-private) mode and logged out of the site. Ubergeek Kelly’s World now rendered quickly and consistently, without a seven plus second delay.

I followed this up by opening Chrome, navigating to Kelly’s World, and logging in as Admin. After doing so, Chrome suddenly started showing the same long delay during rendering as Safari had been. This, to me at least, is sufficient testing to verify my new hypothesis.

This means that the ‘slowness’ of my site’s rendering that I was seeing only applies to me. I’m the only admin user, and thus the only poor sod who has to experience those differences.

I’m curious as to why being logged in as admin makes rendering so slow, but for the moment at least I feel better about my site’s performance. I even tried disabling the Admin ‘taskbar’ UI itself in my user profile, but the site still rendered only after a long delay. It could be something to do with differences in how caching works for logged in users: but that’s not something I have been able to find much detail on.

I’m happy that I found a ’cause’, but it is safe to say that I also feel a bit foolish for not thinking about this as a potential cause until now.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.