Skip to content

URL Configuration Use Cases#

This tutorial covers common use cases for the URL Configuration phase in Peakhour.IO.

1. Set Caching Options for Static Assets#

This filter identifies requests for static assets:

http.request.uri.path matches "*/static/*"

The configuration sets caching options for these requests:

vconf.set:
  cdn_enabled: "true"
  cdn_query_mode: "strip"
  implicit_cache_ttl: "86400"

2. Disable Caching for Dynamic Content#

This filter identifies requests to API endpoints:

starts_with(http.request.uri.path, "/api/")

The configuration disables caching for these requests:

vconf.set:
  cdn_enabled: "false"

3. Enable GZIP Compression#

This filter identifies requests that accept GZIP encoding:

http.request.headers["Accept-Encoding"][0] contains "gzip":

The configuration enables GZIP compression for these requests:

vconf.set:
  gzip: "true"

4. Set Custom Origin for Specific Paths#

This filter identifies requests to blog pages:

starts_with(http.request.uri.path, "/blog/")

The configuration sets a custom origin pool for these requests:

vconf.set:
  origin_pool: "blog_servers"

These examples demonstrate how to use the URL Configuration phase to customise Peakhour settings for different sections of your site.