Content delivery

Content Delivery Networks (CDNs) allow you to quickly deliver your site content by caching content appropriately for improved speed and performance. PaaS uses Fastly as the default CDN. If you’re using Fastly as your CDN, you’ll be able to see all available tabs in the Cockpit.

Select desired cluster

Select your desired cluster from the dropdown menu at the top of the Cockpit.

select cluster id

CDN statistics

You can view your CDN statistics for an active domain in a content delivery server.

You must register a domain in the cockpit. If you haven’t done that, see Networking. The statistics sections remain empty until you enable a domain for the content delivery server.

Purge All

To purge the entire cache from the content delivery server for the domains in the selector, click Purge All. Alternatively, you can purge by URL.

For more, see Purging.

purge cdn all

It does not currently purge your Magnolia instance’s cache.

Purge URL

Instead of purging the entire cache, you may want to simply purge a single object from all cache servers. In this case, you will want to use the Purge URL option in the Cockpit.

  1. Go to Content delivery > Statistics.

  2. Under CDN Actions, click Purge URL.

    purge url

  3. In the dialog:

    1. Choose your desired Domain from the dropdown list.

    2. Enter the URL path of the object that you want to purge.

      This is the path and not the full URL. For example, /path/to/resource.

    3. Optionally select to perform a Soft purge.

      If unselected, a hard purge is performed which immediately makes the object inaccessible. Soft purges mark the object as stale, but it is still accessible.

      Stale objects can reduce backend loads by allowing for conditional revalidation and other performance-enhancing patterns. For more, see Fastly’s soft vs hard purge docs.

    4. Click Purge URL.

      purge url dialog

View stats

  1. Go to Content delivery > Statistics.

  2. Select the desired Domain from the dropdown list.

  3. Select the Range for the statistics.

  4. Click Apply filters.

    stats choose filters

Cache

Statistic Description

Hit ratio

Measurement (expressed as a percentage) of how many content requests the cache filled compared to how many requests it received.

Hit ratio over time

Hit ratio expressed over a timeline.

Cache coverage

The percentage of cacheable requests compared to all requests.

This excludes PASS requests.

Cache statuses

Cache statuses expressed as a percentage by category.

  • HIT means the object was found in the cache.

  • MISS means the object was not found in the cache at the time of the query.

  • PASS means it was flagged to not be cached.

Cache coverage over time

Cache coverage (as a percentage) expressed over a timeline.

Origin

Statistic Description

Requests per zone

Displays (as a map) the requests per geographic zone.

Request per zones and host: <host>

Displays the requests per geographic zone and host.

Requests

Statistic Description

Total requests

Displays the number of total requests.

Total requests last 24 hours

Displays the number of total requests in the last 24 hours.

Total request beginning of month

Displays the number of total requests since the beginning of the current month.

Total request per host

Displays a chart for the number of total requests per host as a percentage.

Requests total

Displays a graph for the request volumes coming in currently on a timeline.

Requests total per host

Displays a graph for the request volumes coming in currently on a timeline per host.

Requests rate

Displays the rate of requests coming in on a timeline. This is requests per second.

Requests rate per host

Displays the rate of requests coming in on a timeline per host. This is requests per second.

Round trip

Statistic Description

Round trip

The average time it took to get a response after initiating network request.

Round trip over last 24 hours

The average time it took to get a response after initiating network request for the last 24 hours.

Round trip since beginning of the month

The average time it took to get a response after initiating network request since the beginning of the month.

Round trip timeline

The average time it took to get a response after initiating network request on timeline.

Round trip timeline per host

The average time it took to get a response after initiating network request on timeline per host.

Duration

Statistic Description

Request duration

Graph showing how long requests are taking on a timeline.

Request duration per status

Graph showing how long requests are taking on a timeline, categorized by status.

Statuses
  • HIT

  • MISS

  • PASS

  • UNKNOWN

Request duration per host

Graph showing how long requests are taking on a timeline, categorized by host.

Traffic

Statistic Description

Traffic

Shows the traffic volume in GB.

Traffic over last 24 hours

Shows the traffic volume in GB over the last 24 hours.

Traffic since beginning of month

Shows the traffic volume in GB since the beginning of the month.

Bytes transferred

Chart showing bytes transferred (in GB) over a timeline.

Bytes transferred by host

Chart showing bytes transferred (in GB) over a timeline, categorized by host.

HTTP statuses

Statistic Description

Error rate

Shows the total percentage of errors.

Error rate over last 24 hours

Shows the total percentage of errors over the last 24 hours.

Error rate since beginning of month

Shows the total percentage of errors since the beginning of the month.

HTTP statuses

Chart showing a breakdown of the HTTP statues returned, categorized by status, such as 200 or 503.

HTTP Info, Success

Timeline showing the number of INFO (206) and SUCCESS (200) responses.

HTTP redirects

Chart showing HTTP redirects requests on a timeline, categorized by HTTP status code such as 302 or 308.

HTTP errors

Chart showing HTTP error requests on a timeline, categorized by HTTP status code such as 404 or 503.

Block IPs

If you spot a malicious IP or need to block IPs for whatever reason, you can block them directly from the Cockpit.

The option to block IPs from the Cockpit is only applicable if you are using Fastly as your CDN. Otherwise, you can block IPs using an ingress.

You can add IPs to block individually or in a batch by uploading a .csv file. You can also see important information about when an IP was added by viewing the information in the Cockpit table.

CIDR Comment Status Created Updated

Example

192.168.0.0/24

Blocking suspicious IPs

Synced

7/11/2024, 16:32:27 UTC user@example.com

7/11/2024, 16:32:27 UTC user@example.com

Description

The IP(s) to block.

A comment typically written to describe the reason for blocking the IP(s).

The status of the IP.

  • Created: IP was created but not yet published.

  • Modified: Existing IP was modified but yet published.

  • Deleted: Existing IP was deleted but not yet published.

  • Synced: No change on item.

When the IP(s) were added/created.

When the IP(s) were updated.

For example, if the IP was edited within the Cockpit.

You can perform actions such as editing and deleting IPs as well as downloading the IPs as a .csv file for further inspection.

block ip overview

Instructions

  1. Go to CDN > Block IP.

  2. Choose to block a single IP or import a list to block:

    • Block IP

    • Block multiple IPs

    1. Click Add IP.

    2. Enter the CIDR[1].

      The appropriate bit prefix (/32 (IPv4) or /128 (IPv6)) is appended automatically.

    3. Add a comment.

    4. Click Block IP.

    IPv6 Example

    block ip

    1. Click Add IP (CSV).

    2. Select the file you wish to upload.

    3. Click Add IP (CSV).

      See an example format and CSV file below these instructions.

    block ip csv

    CSV entry format

    CIDR[1],Comment

    example csv file
    192.169.0.0/16,local network range
    23.45.67.111/32,
    2002::1234:abcd:ffff:c0a8:101/64
    192.169.0.1/12,"commas, in, a, comment, example" (1)
    1 Comments are optional. However, if you use them and there are commas in your comment, be sure to wrap the comment in double quotations. Otherwise, it may be read as a separate entry in the CSV file.

Removed a blocked IP (unblock)

  1. Go to CDN > Block IP.

  2. Choose one of the currently blocked IPs and click Delete selected.

    1. Alternatively, click Delete all to delete all listed IPs.

Download IPs

  1. Go to CDN > Block IP.

  2. Choose one of the currently blocked IPs and click Download selected.

    1. Alternatively, click Download all to download all listed IPs.

  3. This generates a .csv file download with the following information:

    csv
    • id

    • cidr

    • action; this is typically "block" for having blocked the IP

    • comment; any comments entered when adding the IP(s) in the Cockpit

Cache

You can add cache rules from your PaaS Cockpit. Caching reduces requests to Magnolia which helps reduce heavy processing loads and improves performance.

Expand the image here to see the different parts of adding a rule in the Cockpit and is applicable to both cache types.

Rule anatomy

cache rule anatomy

  1. Add a new rule. Once you click this, a new rule is added to the top of the list.

  2. Naming your rule.

  3. Choosing the cache type which is Never or a duration (in minutes).

  4. Add a voter.

  5. Save changes to your rules. This saves changes to Author.

  6. Publish rules to production. This saves changes to Public.

  7. Move rule up or down. Remember the first to match is accepted.

  8. Delete a rule.

Serving stale content origin failure is off by default. Contact support to enable it.

Add Browser cache rule

browserCachePolicy is defined in Magnolia.

Rules

  • The rules apply from top to down.

  • The first rule matching the request defines which Cache-Control header will be applied to the response.

Instructions

To add a Browser cache rule:

  1. Go to your Cockpit.

  2. Go to Content delivery > Cache.

  3. Choose the Browser cache tab.

  4. Click Add a new rule.

    The new rule will appear at the top of the rule list where you can edit it.

    1. Give the rule a Name.

    2. Choose the Type.

      Table 1. options
      Type Description

      Never cache

      You guessed it. It’s never cached.

      Cache for

      Allows you to set the time something is cached for (in minutes).

    3. Choose When it happens using the AND or OR options.

    4. Click the symbol if you want to add any voters.

      1. Choose the condition you want and click Add.

        Each condition comes with a preset set of rules you can choose from.

        For example, URL starts with condition comes with an option of starts with or does not start with whereby you can add a pattern to fulfill that requirement.

    5. When you’re happy with your new rule, don’t forget to save you work by going to the top and clicking Save changes.

    6. To put your rules into production, you’ll also need to Publish your new rule.

Add CDN cache rule

It also helps serve cached content when Magnolia is down or having any issues.

Rules

  • The rules apply from top to down.

  • The first rule matching the request defines which Surrogate-Control header will be applied to the response.

    • The Surrogate-Control header takes precedence over the Cache-Control one.

    • Surrogate-Control headers are removed before a response is sent to an end user.

    • In the absence of the Surrogate-Control header, the CDN uses the Cache-Control header.

Instructions

To add a CDN cache rule:

  1. Go to your Cockpit.

  2. Go to Content delivery > Cache.

  3. Choose the CDN cache tab.

  4. Click Add a new rule.

    The new rule will appear at the top of the rule list where you can edit it.

    1. Give the rule a Name.

    2. Add a directive to the Surrogate Control field.

      What values can be added?
      • max-age: defines how long the response entity can be considered fresh in seconds before it considers the cached entity stale.

      • stale-while-revalidate: defines how long in seconds that the cache can reuse a stale response while it revalidates it to a cache.

      • stale-if-error: indicates when an error is encountered, a cached stale response can be used to satisfy the request, regardless of other freshness information. Unlike stale-while-revalidate, stale-if-error doesn’t allow for any asynchronous revalidation.

      Example: max-age=86400, stale-while-revalidate=60

    3. Choose When it happens using the AND or OR options.

    4. Click the symbol if you want to add any voters.

      1. Choose the condition you want and click Add.

        Each condition comes with a preset set of rules you can choose from.

        For example, URL starts with condition comes with an option of starts with or does not start with whereby you can add a pattern to fulfill that requirement.

    5. When you’re happy with your new rule, don’t forget to save you work by going to the top and clicking Save changes.

    6. To put your rules into production, you’ll also need to Publish your new rule.

CDN settings

Content Delivery Network (CDN) settings play a crucial role in optimizing website performance and enhancing user experience during deployment. You want to ensure that only legitimate visitors are able to gain access to certain areas of your site including administrative or internal areas of your site. It’s important to provide an optimal experience for site visitors during peak times and keep the site up and running. The features shown here in CDN settings help to cover you on both fronts.

Access control

With Access control in PaaS, you’re able to configure rules that prohibit access to certain paths and extensions. This prevents any unintended visits to pages that should be internal or files that should be kept for certain groups or individuals.

Apply CDN restrictions

View from the Cockpit

access control

  1. Go to Content delivery > CDN Settings.

  2. Go to Access control.

  3. Choose the Cluster Id from the dropdown.

  4. Click Apply Filters.

  5. Click the to create a new restriction.

    1. Enter the Path that you want to protect.

      example
      /internal/* (1)
      1 This would protect all areas of the site under internal.
    2. If desired, enable Path matches the start (^). This ensures that the match occurs only if the URL path starts with the specified pattern.

    3. If desired, add any extensions that you explicitly want to protect under this path. The extensions should be separated by commas.

      example
      pdf,txt,jpg,png
  6. Click Apply CDN restrictions.

Geofencing

PaaS’s geofencing lets you control access to your site content based on a user’s geographic location. This allows you to define country boundaries around your site’s access. The feature ensures you’re able to comply with regional regulations, enforce licensing restrictions, or tailor content based on geographic targeting.

Apply Geofencing

View from the Cockpit

geofencing

  1. Go to Content delivery > CDN Settings.

  2. Go to Geofencing.

  3. Click Add rule to add a new geofencing rule.

    1. Select the countries from the menu.

    2. Add the host(s) you want to restrict in the Hosts field.

  4. Click Apply geofencing.

Error responses

You can customise error responses directly from the Cockpit with PaaS. This ensures that when users get a 404 or 503 error, they’ll receive your custom message.

Set custom error page response

View from the Cockpit

custom errors

  1. Go to Content delivery > CDN Settings.

  2. Go to Responses.

  3. Choose the Cluster Id from the dropdown.

  4. Click Apply Filters.

  5. Toggle on the desired error page.

  6. Enter your custom message inside the html element.

    We recommend keeping the messagse concise. There is a maximum 3MB limit for the Fastly configuration which includes these pages and other objects.
  7. Click Apply changes.

Segmented caching

Segmented caching breaks up large files or objects into smaller segments and caches each segment separately, helping optimize content delivery.

Why is this useful?

You should use segmented caching for resources larger than 20 MB to prevent 503 Service unavailable errors for large resource requests.

Imagine you have a large video file. Instead of caching the entire video as one big chunk, segmented caching breaks it into smaller pieces. This allows the CDN to cache each segment separately.

So, for example, if a user only watches a small part of a video, the CDN only needs to fetch and deliver the watched segment, rather than the whole video. This makes resource delivery faster and more efficient.

Apply segmented caching

View from the Cockpit

segmented caching

  1. Go to Content delivery > CDN Settings.

  2. Go to Segmented caching.

  3. Ensure that you have enabled segmented caching by toggling it on.

  4. Specify the file extensions where you want the cache segmented.

  5. Optional Specify the size of the segments in Block size in bytes.

    This defines the size of the segment itself.

  6. Optional Specify which file extensions to which you want the block size to apply.

  7. Click Apply segmented caching.

Fastly Waiting Room

Premium feature

The Fastly Waiting Room is a feature to help you manage high traffic volume on your site and prevent site overload. It assigns a delay for new user requests which allows existing users to finish what they’re trying to do.

The Fastly Waiting Room:

  • Prevents site overload by intelligently handling the influx of new visitors.

  • Fairly distributes the site traffic so that each user has equal chance of access. During high-demand events, promotions, or sales, this can be highly useful.

  • Reduces server load so performance is not hindered.

waiting room journey

Get the Fastly Waiting Room

The Fastly Waiting Room is a premium feature. You’ll need to talk with your PaaS representative to discuss enabling the feature.

You must have the appropriate admin privileges to enable the Fastly Waiting Room. If you go to the Waiting Room in the Cockpit without the appropriate privileges, you’ll see an error page. If your account has the privileges to enable the Fastly Waiting Room, you can follow the instructions here.

Configure the Fastly Waiting Room

  1. In your Cockpit, go to Content delivery > CDN Settings.

    View from the Cockpit

    waiting room cockpit

  2. Go to Waiting room.

  3. Choose the Cluster Id from the dropdown.

  4. Click Apply Filters.

  5. Toggle Enable Waiting Room to enable the feature.

  6. Input the Wait period duration in seconds.

    This is the minimum period of time a visitor must wait before a decision to grant access is made.

  7. Input the Allow percentage. Enter a value between 0 and 100.

    Important considerations

    • This determines what percentage of new requests are allowed to proceed to the site at any point.

    • It helps to control the traffic in a way that prevents server overload.

    • 0 means no new requests are allowed to enter the site.

    • 100 means all new requests are allowed to enter the site.

    The Default is 50 meaning 50% go to the site and 50% go to the waiting room.

  8. Input the Time in seconds a client is allowed to access.

    This is how long the site visitor can stay on the site after access is granted.

    Default is 3600 seconds (60 minutes/1 hour)

  9. Input Page refresh time in seconds.

    This is how long the Waiting Room waits to refresh and check for cookie status. Default is 5 seconds

  10. Input the HTML that is used to render the look and feel of the Waiting Room.

    Sample and tips

    There is a limit of 8000 characters for the field.

    This is just an example. You should use your own template and design to ensure a seamless look and feel for your users.

    <!DOCTYPE html>
    <html lang="en">
       <head>
          <meta charset="UTF-8">
          <title>Waiting Room</title> (1)
       </head>
       <body>
          <div class="container">
             <h1>Welcome to the Waiting Room</h1> (2)
             <p>We apologize for the inconvenience, but the site is quite busy.</p> (3)
             <p>Enjoy this dancing penguin while you wait.</p> (3)
             <img src="dancing-penguin.jpg" alt="Dancing Penguin funny">
          </div>
       </body>
    </html>
    1 Give the Waiting Room a meaningful title.
    2 Write a thoughtful header.
    3 It’s important to explain what is happening to the user.

1. Classless Inter-Domain Routing. For more, see here.
Feedback

PaaS

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the Magnolia PaaS docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules