Page tree
Skip to end of metadata
Go to start of metadata
This module provides filter functionality to throttle http requests coming to magnolia.

Installation

Maven is the easiest way to install the module. Add the following dependency to your bundle:

 <dependency>
      <groupId>info.magnolia.tools</groupId>
      <artifactId>magnolia-throttling-filter</artifactId>
      <version>${version}</version>
  </dependency>

Versions

6.2Magnolia 6.2

Usage

The module used by other modules like commenting and shop to limit the requests comment to Magnolia.

Configuration

Add the filter configuration under /server/filters in magnolia configuration app. Following code block shows a sample configuration:

throttling:
  class: 'info.magnolia.throttling.filter.ThrottlingFilter'
  enabled: true
  jcr:primaryType: 'mgnl:content'
  numberOfRequestsPerSecond: '0'
  numberOfRequestsPerSecondByUser: '1'
  requestType: 'GET'
  mappings:
    throttle-home:
      pattern: 'regex:^\/\home(\.html)?$'


Filter accepts three parameters:

  • numberOfRequestsPerSecond
  • numberOfRequestsPerSecondByUser
  • requestType

First two parameters accept Integer number. If you pass '0' to these parameters there will be no limitation on the number of requests per second.

Third parameter accepts request type (String). For example: GET, POST, PUT etc ...

First parameter will limit total number of requests that are coming to the url configured in the mappings section.
Second parameter will limit total number of requests that are coming to the url configured in the mappings section for authenticated user.
Requests that are not authenticated (no user logged-in) will fallback to ip-address and in case no ip-address is available will fallback to user session.

Warnings

  • This module is at INCUBATOR level.

Changelog

  • Version 1.0 - Initial release of the extensions version of the module.
    • Put links to relevant tickets to help others