Jump to content

session cache limiter


hisoka
 Share

Recommended Posts

I read but I could not understand as this is too complicated for me :

 

 

The cache limiter defines which cache control HTTP headers are sent to the client. These headers determine the rules by which the page content may be cached by the client and intermediate proxies. Setting the cache limiter to nocache disallows any client/proxy caching. A value of public permits caching by proxies and the client, whereas private disallows caching by proxies and permits the client to cache the contents.

 

and this is worser than the first :(

 

session.save_path defines the argument which is passed to the save handler. If you choose the default files handler, this is the path where the files are created. See also ......

 

 

you have other articles that are simpler than that ? or may be you can simplify the above for me :)

Link to comment
Share on other sites

Do you know what browser caching is? The cache limiter is the group of headers sent to the browser to tell it not to cache (or, more specifically, how to cache). If you don't know what browser caching is, then look it up.By default, PHP saves session data using text files. The save path is the location where those files get saved.

Link to comment
Share on other sites

Browser caching : Pronounced "browser cash." A temporary storage area in memory or on disk that holds the most recently downloaded Web pages. As you jump from Web page to Web page, caching those pages in memory lets you quickly go back to a page without having to download it from the Web again. In order to ensure that the latest page is displayed, the browser compares the dates of the cached page with the current Web page. If the Web page has not changed, the cached page is displayed immediately. If the Web page has changed, it is downloaded, displayed and cached.

In computing, active data is often cached to shorten data access times, reduce latency and improve input/output (I/O). Because almost all application workload is dependent upon I/O operations, caching is used to improve application performance.

For example, Web browsers such as Internet Explorer, Firefox, Safari and Chrome use a browser cache to improve performance for frequently accessed webpages. When you visit a webpage, the files your browser requests are stored on your computing storage in the browser's cache. If you click "back" and return to that page, your browser can retrieve most of the files it needs from cache instead of requesting they all be sent again. This approach is called read cache. It is much faster for your browser to read data from the browser cache than to have to re-read the files from the webpage.

the caching mechanism is controled by set of rules that must be obeyed :

  1. If the response’s headers tell the cache not to keep it, it won’t.
  2. If the request is authenticated or secure (i.e., HTTPS), it won’t be cached.
  3. A cached representation is considered fresh (that is, able to be sent to a client without checking with the origin server) if:
    • It has an expiry time or other age-controlling header set, and is still within the fresh period, or
    • If the cache has seen the representation recently, and it was modified relatively long ago.

Fresh representations are served directly from the cache, without checking with the origin server. [*]If a representation is stale, the origin server will be asked to validate it, or tell the cache whether the copy that it has is still good. [*]Under certain circumstances — for example, when it’s disconnected from a network — a cache can serve stale responses without checking with the origin server.

If no validator (an ETag or Last-Modified header) is present on a response, and it doesn't have any explicit freshness information, it will usually — but not always — be considered uncacheable.

Together, freshness and validation are the most important ways that a cache works with content. A fresh representation will be available instantly from the cache, while a validated representation will avoid sending the entire representation over again if it hasn’t changed.

 

These rules are defined by :

Cache-Control HTTP Headers

which in turn are defined by :

 

The cache limiter

 

But what has all this to do with a session ??

Edited by hisoka
Link to comment
Share on other sites

"By default, PHP saves session data using text files. The save path is the location where those files get saved."

 

So session.save_path defines the path (location) of the files sessions . If I am wrong can you correct me ?

Link to comment
Share on other sites

I didn't ask you to copy and paste definitions, I asked you if you know what that means.

But what has all this to do with a session ??

PHP will tell the browser to not cache pages that use a session, because the data on the page might change.

So session.save_path defines the path (location) of the files sessions .

If sessions are saved using files, then yes that's what it defines.
Link to comment
Share on other sites

"PHP will tell the browser to not cache pages that use a session, because the data on the page might change"

 

I think all web pages the user visits use sessions to identify the user and his activities in that specific website and among them the web pages that are cached in the user computer .

Link to comment
Share on other sites

"In PHP, when you start a session, the cache limiter sends headers to tell the browser how to handle caching for that page. That's the answer to your question."

 

yes this is the answer to my question : "But what has all this to do with a session ??"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...