Caching in Publish instance
Hi,
I wanna cache publish requests and responses.
I did changes in dispatcher.any for publish instance.
After restarting the apache webserver for the first request am getting Geometrix welcome page but for the second request amgetting html page.
Ex:
<!DOCTYPE HTML> <html> <head> <meta charset="utf-8" /> <title>Geometrixx Outdoors</title> <link rel="canonical" href="http://192.168.5.109/content/geometrixx-outdoors/en.html"/> <link rel="shortcut icon" href="https://forums.adobe.com/etc/designs/geometrixx-outdoors/favicon.ico"/> <script> document.documentElement.className+=' js'; /*@cc_on(function(){var e=['abbr','article','aside','audio','canvas','details','figcaption','figure','footer','header','hgroup','mark','meter','nav','output','progress','section','summary','time','video'];for (var i = e.length; i-- > 0;) document.createElement(e[i]);})();@*/ </script> <script type="text/javascript" src="/etc/clientlibs/granite/jquery.js"></script> <script type="text/javascript" src="/etc/clientlibs/granite/utils.js"></script> <script type="text/javascript" src="/etc/clientlibs/granite/jquery/granite.js"></script> <script type="text/javascript" src="/etc/clientlibs/foundation/jquery.js"></script> <script type="text/javascript" src="/etc/clientlibs/foundation/shared.js"></script> <script type="text/javascript" src="/etc/designs/geometrixx-outdoors/clientlibs_desktop_v1.js"></script> <link rel="stylesheet" href="https://forums.adobe.com/etc/designs/geometrixx-outdoors/clientlibs_desktop_v1.css" type="text/css">
The dispatcher config file is..
# Each farm configures a set of load balanced renders (i.e. remote servers)
/farms
{
# First farm entry
/publish
{
# Request headers that should be forwarded to the remote server.
/clientheaders
{
# Forward all request headers that are end-to-end. If you want
# to forward a specific set of headers, you'll have to list
# them here.
"*"
}
# Hostname globbing for farm selection (virtual domain addressing)
/virtualhosts
{
# Entries will be compared against the "Host" request header
# and an optional request URL prefix.
#
# Examples:
#
# www.company.com
# intranet.*
# myhost:8888/mysite
"*"
}
# The load will be balanced among these render instances
/renders
{
/rend01
{
# Hostname or IP of the render
/hostname "192.168.5.109"
# Port of the render
/port "4503"
# Connect timeout in milliseconds, 0 to wait indefinitely
# /timeout "0"
}
}
# The filter section defines the requests that should be handled by the dispatcher.
# The globs will be compared against the request line, e.g. "GET /index.html HTTP/1.1".
/filter
{
/0000
{
/url "/*"
/type "allow"
}
# Deny external access to system console
/0001
{
/url "/system/*"
/type "allow"
}
# Deny external access to CRX web application
/0002
{
/url "/crx*"
/type "allow"
}
# Deny external access to servlet engine console
/0003
{
/url "/admin/*"
/type "allow"
}
# allow access to logout
/0004
{
/url "/system/sling/logout*"
/type "allow"
}
}
# The cache section regulates what responses will be cached and where.
/cache
{
# The docroot must be equal to the document root of the webserver. The
# dispatcher will store files relative to this directory and subsequent
# requests may be "declined" by the dispatcher, allowing the webserver
# to deliver them just like static files.
/docroot "/opt/cq/publish/crx-quickstart/dispatcher/cache"
# Sets the level upto which files named ".stat" will be created in the
# document root of the webserver. When an activation request for some
# page is received, only files within the same subtree are affected
# by the invalidation.
#/statfileslevel "0"
# Flag indicating whether to cache responses to requests that contain
# authorization information.
# This needs to be set to "1" for an author instance, as all requests
# to an author instance contain authorization information.
# This means that the cache rules must never allow caching of content
# that contains user specific information.
/allowAuthorized "0"
# Flag indicating whether the dispatcher should serve stale content if
# no remote server is available.
#/serveStaleOnError "0"
# The rules section defines what responses should be cached based on
# the requested URL. Please note that only the following requests can
# lead to cacheable responses:
#
# - HTTP method is GET
# - URL has an extension
# - Request has no query string
# - Request has no "Authorization" header (unless allowAuthorized is 1)
/rules
{
/0000
{
# Disallow any caching by default and subsequently allow caching
# for content that may be cached although requested with authorization
# information present in the request
/glob "*"
/type "allow"
}
/0001
{
# Allow caching of requests to /libs
/glob "/libs/*"
/type "allow"
}
/0002
{
# This contains user information
/glob "/libs/cq/security/userinfo.*"
/type "deny"
}
/0003
{
# This page contains a "Welcome, User XXX" message
/glob "/libs/cq/core/content/welcome.*"
/type "allow"
}
# /0004
# If your application is designed to allow caching of requests to /apps
# enable this rule after careful validation that no user specific content
# is cached.
# {
# /glob "/apps/*"
# /type "allow"
# }
}
# The invalidate section defines the pages that are "invalidated" after
# any activation. Please note that the activated page itself and all
# related documents are flushed on an modification. For example: if the
# page /foo/bar is activated, all /foo/bar.* files are removed from the
# cache.
/invalidate
{
/0000
{
/glob "*"
/type "deny"
}
/0001
{
# Consider all HTML files stale after an activation.
/glob "*.html"
/type "allow"
}
/0002
{
/glob "/etc/segmentation.segment.js"
/type "allow"
}
/0003
{
/glob "*/analytics.sitecatalyst.js"
/type "allow"
}
}
# The allowedClients section restricts the client IP addresses that are
# allowed to issue activation requests.
/allowedClients
{
# Uncomment the following to restrict activation requests to originate
# from "localhost" only.
#
#/0000
# {
# /glob "*"
# /type "deny"
# }
#/0001
# {
# /glob "127.0.0.1"
# /type "allow"
# }
}
# The ignoreUrlParams section contains query string parameter names that
# should be ignored when determining whether some request's output can be
# cached or delivered from cache.
#
# In this example configuration, the "q" parameter will be ignored.
#/ignoreUrlParams
# {
# /0001 { /glob "*" /type "deny" }
# /0002 { /glob "q" /type "allow" }
# }
}
# The statistics sections dictates how the load should be balanced among the
# renders according to the media-type.
/statistics
{
/categories
{
/html
{
/glob "*.html"
}
/others
{
/glob "*"
}
}
}
}
}
Please let me know if i did any mistake.
Thanks in Advance,
Mahesh