Can the proxy server cache individual pictures from websites?
Sim.
would all of the webpage have to be requested again due to its dynamic capacity?
As partes dinâmicas teriam que ser reexaminadas, o proxy deve cuidar disso examinando os cabeçalhos de controle de proxy em cada elemento buscado separadamente da página.
Veja um pequeno exemplo (editado) de uma captura do Chrome pelo Wireshark buscando uma página da Web do Superusuário
Solicitação do cliente
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: …
Resposta do servidor
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
Observe que Cache-Control: public, max-age=60
e Expires: Wed, 02 May 2012 19:41:23 GMT
são assim que o servidor tenta controlar como cada parte do conteúdo é armazenada em cache. Uma página de pergunta de superusuário pode ter dezenas ou centenas desses elementos buscados individualmente.
Leia o que W3C diz sobre o controle de cache
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.
mais tarde
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.
e assim por diante - é uma grande área de assunto.