Question : How a Proxy Cache works?

hi,

Proxies aim to improve the performance offered by the Web, providing end users with faster access to its resources.

my question is like when a webpage is accessed the contents of the page remains in the proxycache. when another user requests the same page it is given to the user from the cache. in case if the contents of the page is changing every time (like some thing i buy in www.ebay.de) in this case how it works.

any ideas welcome.

Answer : How a Proxy Cache works?

Cache server vs content.

Content can be dynamic and static.
Static content - text, images, java scripts - those do not change, they are sitting on a Web Site and are serverd upon a request from client.
Dynamic content - pages that are generated by the Web Server upon a request - query, posting a form, etc.

There are 2 paramters for content that you can identify in IE cache for example: "Last Modified" and "Expires".
In case that "Last Modified" has no value - this is a file which is a dynamic content and if it has a value - its static.

"Expires" parameter is set in order to refresh the content after the time set in "expires" is reached.


Now about the Cache proxies:

1. Cache has 3 purposes:
- Decrease Bandwidth usage by bringing the content closer to the client (Browser).
- Serve the content faster
- Decrease load on the Web Servers.


2. Caching algorithms:

Static content is server from cache until "expires" point is reached.
In case that "expires" has no value - static content will not be ever refreshed.

When "expires" point is reached - proxy will forward the request from the browser to the Web Server with a message - is the content still valid? and if it will receive a positive answer from the Web Server - than the content will be downloaded from the Web Server, added to Cache and served to the client (Browser).
Otherwise - the content will be served from the Cache but "expires" will be updated.

Dynamic content is not cached - and it shouldn't . Lets make as an example : the content on the page is current Stocks numbers - you woulnd't want to get them from cache because they will be old news then.

There are some ways to cache dynamic content as well, while not serving an obsolete content: its called "selective caching". Proxy will scan every dynamic page passing through it and will interpret it into 2 parts: static (part of the page that is not changed) and dynamic - changing part. Usually "static" part of dynamic page is >> than the dynamic part. So its worth caching it.

In case you have more questiong - please ask.
Random Solutions  
 
programming4us programming4us