Spokalyالإنجليزية تبدأ من السمع
مقابلات العمل · مبرمج · متقدّم

تسريع صفحة بطيئةMaking a Slow Page Faster

  • Ms. Brandt
  • Hugo
0:00 / 2:24
الشريط الملوّن مقسوم حسب المتكلّم، فترى من يتحدّث ومتى.

النص

  1. Ms. Brandt
    Here is a small problem. Our product page takes six seconds to load. How would you approach it?
  2. Hugo
    Before I guess, I would measure. I would find out whether the time is spent on the server, on the network, or in the browser.
  3. Ms. Brandt
    Say the measurement shows that the server is slow. What next?
  4. Hugo
    Then I would look at the database queries. One common problem is that the page asks for the same data many times. If so, I would save the result for a short time, so the next visitor gets it faster.
  5. Ms. Brandt
    Is there a risk in saving the result?
  6. Hugo
    Yes. The saved data can become old. If a price changes, some visitors may see the old price. So I would choose how long to keep it, and I would remove it when the price is updated.
  7. Ms. Brandt
    How would you know that the change really helped?
  8. Hugo
    I would measure again with the same method. Then I would compare. I would also watch the page for a few days, because a test on my computer does not always match what real users see.
  9. Ms. Brandt
    What if the slow part is in the browser?
  10. Hugo
    I would check the size of the images and the amount of code we send. Often the simplest fix is to make the images smaller and to load the ones below the screen later.
  11. Ms. Brandt
    Now imagine that the product manager wants a new feature, but the page is still slow. What would you say?
  12. Hugo
    I would not simply say no. I would show the numbers and explain what a slow page costs us: some visitors leave before it loads. Then I would suggest an order of work, for example a small speed fix this week and the feature after that.
  13. Ms. Brandt
    And if the manager still wants the feature first?
  14. Hugo
    Then it is the manager's decision, because the manager knows the business better than I do. I would only ask to add a simple speed check to the new feature, so it does not make things worse.
  15. Ms. Brandt
    How would you explain the problem to someone who is not technical?
  16. Hugo
    I would use an everyday example. A shop with one cashier gets a long line when many customers arrive. Saving the data is like adding a second cashier for the most common questions. People understand that quickly.
  17. Ms. Brandt
    Good. You explained your thinking, not only your answer. Thank you.