According to How to serve stale content in case no render is available I have configured /serveStaleOnError on our dispatcher(apache 2.2 dispathcer 4.2.3/4.2.2).
For testing purpose I've created the following page:
<html>
<head>
<title>Throwing an Exception</title>
</head>
<body>
<title>Throwing an Exception</title>
<%
response.sendError(503, "test failure" );
%>
</body>
</html>
serveStaleOnError works fine for 503:
And doesn't work for 504,502:
What am I doing wrong? Should anything else be configured?
Solved! Go to Solution.
Views
Replies
Total Likes
From what I understand, StaleOnError only works when it encounters one of these status codes:
* BAD_GATEWAY (502)
* SERVICE_UNAVAILABLE (503)
* GATEWAY_TIMEOUT (504)
So the functionality should be given in all your testcases.
Regarding your tests: Do you have a file /u/docroot/website.com/content/website/sitemap.styles.xml already in the filesystem, which can be delivered as stale file?
Jörg
From what I understand, StaleOnError only works when it encounters one of these status codes:
* BAD_GATEWAY (502)
* SERVICE_UNAVAILABLE (503)
* GATEWAY_TIMEOUT (504)
So the functionality should be given in all your testcases.
Regarding your tests: Do you have a file /u/docroot/website.com/content/website/sitemap.styles.xml already in the filesystem, which can be delivered as stale file?
Jörg
Hello Jörg,
Yes I was verifying that files are cashed before I request it, but only 503 was returning content from cache.
When I was requesting resource with 502 and 504, cache was deleted and 502/504 status was returned on dispacher
Thank you,
Yaraslau
@yaraslaud208334 I can confirm that only 503 error code will force Dispatcher to return cached page. Rest of the error codes will remove your cached file.
BONUS: If you are using ACS Commons Error Handler and have Throwable.jsp update its reponse status code to 503 to return cached page no matter what error you get.
@Jörg_Hoh can you tell us if there is any plans to opensource Dispatcher source code? It will make it so much easier to answer and fix these errors.
@Jörg_Hoh can you tell us if there is any plans to opensource Dispatcher source code? It will make it so much easier to answer and fix these errors.
Sorry, I cannot.
Views
Replies
Total Likes
Hm, then I don't know. Can you raise a ticket at Adobe support and describe your findings?
thanks,
Jörg
Views
Likes
Replies
Views
Like
Replies