Skip to main content

Serve Repeated Requests Locally

Every request that reaches the origin costs bandwidth and latency the user feels. Caching stores local copies of requested content and serves later requests from disk; prefetching goes further and retrieves resources referenced in an HTML page before the user asks for them. They are complementary, and they are configured separately. Caching is the store; prefetching is what fills it ahead of demand.

Choose which to enable

Enable caching first and confirm objects land in the store. Prefetching without a working cache generates origin traffic and discards it.
Cache and prefetch policy interacts with inspection and privacy scope. Do not cache content from destinations excluded from inspection, or from categories where a shared local copy would expose one user’s content to another. Confirm the scope with the policy owner before enabling either.

Configure content caching

Create the access policy

  1. Access the SafeSquid User Interface and click Configure. Configure page
  2. Navigate to Access Policies under Restriction Policies. Access Policies section
  3. Click Add New to create a new policy. Add new policy
  4. Enter a descriptive comment for reference. Policy comment
  5. Select the desired categories from the Categories dropdown. Select categories
  6. Set Action to Allow. Set action
  7. Assign a unique name in Added Profiles. Added Profiles
  8. Click Save Policy. Save policy

Configure the caching store

  1. Navigate to Caching under Application Setup. Caching section
  2. Click the Store tab. Store tab
  3. Click Clone to duplicate an existing policy. Clone policy Duplicated policy
  4. Click Edit Policy on the cloned entry. Edit policy
  5. Set Enabled to True. Enable policy
  6. Add an appropriate comment for future reference. Policy comment
  7. Select the profile created earlier from the Profiles dropdown. Select profile
  8. Click Save Policy. Save caching policy
  9. Click Save to apply the configuration globally. Global save

Configure prefetching

Prefetching fetches and caches files referenced in HTML before the user requests them. It applies to a wider set of resources than caching alone.
  1. Access the SafeSquid User Interface and click Configure. Configure page
  2. Navigate to Prefetching under Application Setup. Prefetching section
  3. Ensure the Global section has Enabled set to True. Global enabled
  4. Click the Prefetch tab. Prefetch tab
  5. Click Add New to create a new policy. Add new policy
  6. Enter an appropriate comment for future reference. Policy comment
  7. Specify the HTML tag to analyze for prefetchable URLs. HTML tag specification
  8. Specify the attribute of the HTML tag holding the URL to prefetch. Tag attribute
  9. Specify the regular expression to evaluate discovered URLs in the tag attribute. URL regex
  10. Click Save Policy. Save policy
  11. Click Save Config to apply the configuration. Save config Configuration saved
Keep the regular expression narrow. A broad pattern prefetches every URL the tag attribute can hold, which turns a latency optimisation into an origin-traffic multiplier.

Verify objects are cached

  1. Navigate to Manage Cached Objects in the Caching section. Manage Cached Objects
  2. Verify cached websites appear under disk cache. Disk cache contents
Expected result: content from the categories in the access profile appears in the disk cache after a client requests it. An empty store after browsing means the access profile is not matching, or the store policy is not enabled — check the profile name in both places before adjusting cache size.

Capture caching evidence

Store these artifacts with the change record:
  • The access profile name and the categories it matches.
  • Confirmation that the store policy references that same profile.
  • A Manage Cached Objects listing showing entries after a test browse.
  • The prefetch tag, attribute, and regular expression used.
  • Confirmation from the policy owner that cached categories are appropriate to share.

Troubleshoot caching and prefetching

Next steps