• No se han encontrado resultados

Prerrequisitos para determinar el tiempo estándar

Capítulo 3 ESTUDIO DE METODOS Y TIEMPOS

2. Estudio del tiempo

2.2. Prerrequisitos para determinar el tiempo estándar

When pages are downloaded to the client machine, browsers can automatically store these pages using the browser caching mechanism. However, the browser can try to re-download these files even though they might not have changed. To make sure that the pages are stored for a longer period, an expiry data can be set on the HTTP headers to let the browser know that it does not need to fetch the resource again until the expiry date is reached [62].

Some of the major browsers like Google chrome and Internet Explorer use a heuristic in order to make a decision on how long they can store the files for, if an expiry date is not set on the HTTP headers. Both HTTP and HTTPs pages can be cached although older versions of browsers will only cache HTTP content.

In order to make sure that we take advantage of caching on all web browsers, the web server must be setup to set expiry dates on all resources that can be cached such as CSS, JavaScript, HTML and images files or other binary resources like video and audio.

HTTP/1.1 Caching Response Headers

ExpiresandCache-Control: max-agestipulate the duration in which a web browser can consider the content up-to-date before asking the web server for a newer ver- sion of the resource.

the server and the server will check the resource to see if it has been changed or is still the same as that stored at the client. With theEtagheader, a unique identifier or version number is set on a resource. The resources are only downloaded to the client if this unique identifier has been modified.

To make sure that you limit any unnecessary downloads, all static files should have their cache headers set. The duration of the cache should be dependent on how the application gets used and how the contents frequently changes. How- ever having a minimum of one to twelve months is a good start. As much as the expiry date of a resource can be set to more than twelve months, it is nevertheless not recommended. It is highly recommended to use the Expires headers as most of the browsers support it compared to theCache-Control: max-age. Most of the web browsers delete their cache based on a process that checks to see when the resource was last used.

Fingerprinting Frequently changing resources

There are some files that we want to cache even though they change frequently. These can still be set to have their expiry date way in the future, but can have a “finger print” that will enable the file to be re-downloaded when a more recent ver- sion is available. This can be achieved by this by adding a “fingerprint” or unique identifier to the URL of the resource. Whenever the server wants the client to down- load the files again, all we do is to change the fingerprint. When the finger print changes this also changes the URL, hence the web browser recognizes this as a new file and will force the re-downloading of the file.

Leveraging Proxy Caching

We have been taking about net unavailability in relation to the client not being able to access any network. There are, however, some cases where the user might only have access to access to certain networks. If the application the user is try- ing to access is on an unreachable server, this is normally a good candidate for proxy caching. Resources can be cached or made to be downloaded from the neighboring proxy server instead of getting it from the remote origin web server [68].

Proxy caching is good in that even web users who have never downloaded the web application from the origin server can still gain access to the application through the proxy servers. Proxy servers are usually closer to the web user and therefore, this can lead to a substantial decrease in network latency thereby in- crease in performance.

Cache-control: a public caching header can be used specify that a file is avail- able for caching by both the requesting client browser and the public web proxies.

Proxy Caching Considerations

It is important to note that some proxy servers do not cache resources that have a query string as part of the URL. This limitation can be overcome by encoding the query string into the requested page filename.

When using proxy caching, some proxy servers do not cache pages that use cookies. For those that do, all cookies that are set by the pages are accessi- ble to all the web users, as a result the cookies should not be set for individual use.

Some proxies cannot handleContent-Encoding properly and this can lead to files being delivered to the client in a format that will not be usable e.g. send- ing a compressed file to a browser that cannot decompress the file. The use of Cache-Control header for such a resource should be set to private so as to stop the proxy from caching the resource.

The proxy can store different versions of the same file when Accept-Encoding response header is set to Vary, for example, if a proxy can store both com- pressed and uncompressed versions of the resource then in the end the clients that can handle the compressed version will receive compressed version while those that cannot will receive the uncompressed version [69].

Documento similar