Skip to main content

Posts

Showing posts from October, 2014

A Simple Output Cache Solution for DD4T Java

This blog post presents a very simple output cache solution presented in the form of a Java Servlet filter. The output cache works together with DD4T Java, although it is a pretty generic solution. The idea behind this output cache is to store the response output in a memory cache, such that a subsequent request to the same URL will load the cached response content from cache, instead of letting it be processed again through the normal request processing pipeline. This approach has, of course, a few constraints — namely, the biggest being there cannot be any personalization in the response based on users. The response is the same for several requests which might belong to several users, sessions, cookies, etc. Hence this ‘simple’ output cache. The output cache filter uses the incoming request URL as a key in the local memory cache. If a previously cached response is found in cache, it will be served; otherwise, the request is let go through the processing pipeline and the resu

Extending Tuckey URL Rewrite Filter with Tridion-published rules

This post shows a way of extending Paul Tuckey’s URL rewrite filter ( https://code.google.com/p/urlrewritefilter/ ). Namely, it extends the Java version 4.0.3 of the filter and makes it use rewrite/redirect rules published from Tridion. The rules are published to the Content Delivery Database as a dynamic DD4T page, and use specific view model objects that make reading the rules very easy. The extension I wrote will also attempt to load the existing rules in file “ /WEB-INF/urlrewrite.xml ” - the default configuration file used by URL rewrite filter. Tridion Part We define an Embedded Schema called EmbeddedRedirect having the following fields: from - single value text; to - single value text; permanent - singe value drop down or radian button text field based on values of a list with possible values “Yes” or “No”; We define a Schema called Redirects having the following field: redirect - multi value embedded field based on Schema EmbeddedRedirect ; Next, we a