Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

/serveStaleOnError doesn't work for 502 and 504

yaraslaud208334
Level 3
Level 3

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?

1 Accepted Solution
Jörg_Hoh
Correct answer by
Employee
Employee

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

View solution in original post

5 Replies
Jörg_Hoh
Correct answer by
Employee
Employee

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

yaraslaud208334
Level 3
Level 3

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

maxbarrass-anchora
Level 2
Level 2

@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
Employee
Employee

@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.

 

Jörg_Hoh
Employee
Employee

Hm, then I don't know. Can you raise a ticket at Adobe support and describe your findings?

thanks,

Jörg