What does the cache control value control in a static resource?

While creating a static resource there is an option for specifying Cache Control, This contains two values Public and Private.
enter image description here

What does these values actually control?.

Initially had an Idea that if its public, it can be refered from outside salesforce.

Answer

From the docs:

Private specifies that the static resource data cached on the
Salesforce server shouldn’t be shared with other users. The static
resource is only stored in cache for the current user’s session.

Note Cache settings on static resources are set to private when
accessed via a Force.com site whose guest user’s profile has
restrictions based on IP range or login hours. Sites with guest user
profile restrictions cache static resources only within the browser.
Also, if a previously unrestricted site becomes restricted, it can
take up to 45 days for the static resources to expire from the
Salesforce cache and any intermediate caches.

Public specifies that the static resource data cached on the
Salesforce server be shared with other users in your organization for
faster load times.

There’s a good article on static resources and Visualforce on the developerforce wiki at:

http://wiki.developerforce.com/page/Delivering_Static_Resources_with_Visualforce

Attribution
Source : Link , Question Author : Avidev9 , Answer Author : Bob Buzzard

Leave a Comment