Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a more than less generalized question(s) regarding proxy caching servers.

Just to set up a hypothetical scene, I have been playing with the idea of installing a proxy cache server within my home to try and help with reducing the amount of traffic that flows across the router (ISP has a cap on the total amount of data can be used). The server would be located on the inside of the router so the router will be unaware of some data being stored

About how effective would a proxy cache server be in this case? (also, what other means can I implement to reduce network traffic across the router)

Can the proxy server cache individual pictures from websites? Example, a forum often updates the content, but images that are displayed on the website are not altered. Could some of the information regarding a website be saved? Or would all of the webpage have to be requested again due to its dynamic capacity?

I am relatively new to the capabilities of proxy servers and if I can find enough information about it I would eventually like to bring it over to my work in IT.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Can the proxy server cache individual pictures from websites?

Yes.

would all of the webpage have to be requested again due to its dynamic capacity?

The dynamic parts would have to be refetched, the proxy should take care of this by examining the proxy-control headers in each separately fetched element of the page.


Here's a short (edited) example of a Wireshark capture of Chrome fetching a web-page from Superuser

Client Request

GET /questions/419790/confused-by-cpu-model HTTP/1.1
Host: superuser.com
Connection: keep-alive
User-Agent: …Chrome…
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://superuser.com/questions
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: …

Server Response

HTTP/1.1 200 OK
Cache-Control: public, max-age=60
Content-Type: text/html; charset=utf-8
Content-Encoding: gzip
Expires: Wed, 02 May 2012 19:41:23 GMT
Last-Modified: Wed, 02 May 2012 19:40:23 GMT
Vary: *
Date: Wed, 02 May 2012 19:40:23 GMT
Content-Length: 9831

Note the Cache-Control: public, max-age=60 and the Expires: Wed, 02 May 2012 19:41:23 GMT this is how the server attempts to control how each piece of content gets cached. A superuser question page may have dozens or hundreds of such individually fetched elements.

Read what W3C say about Cache-control

The Cache-Control general-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. The directives specify behavior intended to prevent caches from adversely interfering with the request or response. These directives typically override the default caching algorithms. Cache directives are unidirectional in that the presence of a directive in a request does not imply that the same directive is to be given in the response.

later

public
Indicates that the response MAY be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache. (See also Authorization, section 14.8, for additional details.)

private
Indicates that all or part of the response message is intended for a single user and MUST NOT be cached by a shared cache. This allows an origin server to state that the specified parts of the response are intended for only one user and are not a valid response for requests by other users. A private (non-shared) cache MAY cache the response. Note: This usage of the word private only controls where the response may be cached, and cannot ensure the privacy of the message content.

no-cache
If the no-cache directive does not specify a field-name, then a cache MUST NOT use the response to satisfy a subsequent request without successful revalidation with the origin server. This allows an origin server to prevent caching even by caches that have been configured to return stale responses to client requests.

and so on - it's a large subject area.

share|improve this answer
    
Awesome. This is providing me with hope that it can accomplish a lot provided I have enough work and research on it. So, if I am understanding correctly (and with a relatively weak understanding of how website content works), if the proxy server caches a request for a webpage with dynamic content, would it save the 'old' dynamic content? For example, on a forum (best example I can think of for some reason) you have old threads that haven't been discussed for a time. Would this content be saved, and the new threads be refreshed, resulting in reduced network activity? –  Stephen R May 2 '12 at 16:47
    
Depends on the content and cache expiration, for obvious reasons. –  user3463 May 2 '12 at 17:22
    
@StephenR: See update. If you want to understand this, I believe it is necessary to do some background reading. –  RedGrittyBrick May 2 '12 at 19:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.