How do I measure site speed for logged in users? The tools like pingdom, google page speed etc, check site speed for guests. the reason I ask is this.
My site is fast for guests because I have page caching. For logged in users, I don’t have the pages cached and hence it is extremely slow. The end result is that my most loyal visitors (logged in users) are getting a slow site. If I can accurate measure it, I can move towards fixing it. Appreciate the help.
I handled this by creating a test user on the system (let’s call the login
my_test_user
) and then added an action hook oninit
to check the URL for a token, and if the token is found it logs in as the test user before running the rest of the page. You can use whatever you want as the token as long as it is long and random enough, but this is a decent generator. Keep in mind that you should be using this via SSL (but then again, so should your logins with password).From a security standpoint I would recommend hard coding the test user either in the code or as a constant in
wp-config.php
. If this is ever compromised, you don’t want the hacker to be able to log in as any user, and your test user should have limited permissions. Perhaps even consider another token/key to enable/disable the functionality based on awp_option
value and only turn on when testing.Once added to your
functions.php
you can use any URL in your tools appended with?login_token=YOUR_LOGIN_TOKEN
to view it asmy_test_user
.