Leiste mit Community-Erfolgen erweitern.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.

GELÖST

\/serveStaleOnError doesn't work for 502 and 504

Avatar

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 Akzeptierte Lösung

Avatar

Korrekte Antwort von
Employee Advisor

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

Lösung in ursprünglichem Beitrag anzeigen

5 Antworten

Avatar

Korrekte Antwort von
Employee Advisor

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

Avatar

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

Avatar

Adobe Champion

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

Avatar

Employee Advisor

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

 

Avatar

Employee Advisor

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

thanks,

Jörg