Knowledgebase

How a PHP Request Is Handled Print

  • phplaravel, php, woocommerce, caching, database, guide, howto, solution
  • 0

The request lifecycle.

WHAT HAPPENS

A request arrives at the web server The server passes it to PHP PHP executes the relevant file The output is returned The process ends

WHAT MATTERS ABOUT THAT LAST POINT

Each request starts fresh.

Nothing persists between requests unless you store it somewhere.

WHAT THAT MEANS

Variables do not survive State must be held in a session, a database, a cache or a file

WHY THAT DESIGN

It makes applications simple to reason about and easy to scale.

WHAT IT COSTS

Everything must be loaded again each request.

WHAT THAT IMPLIES

Loading less, and caching what is expensive, matters considerably.

WHAT SESSIONS DO

Associate data with a visitor across requests, using an identifier.

WHAT TO UNDERSTAND

Where sessions are stored, and that they consume space.

WHAT ELSE TO KNOW

Time limits apply to execution, and memory limits apply per request.

Both are configurable within your plan's bounds.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot