Expand my Community achievements bar.

Cached Suffix URLs causing 404 error for the original page

Avatar

Level 3

I am working on a developed AEM site where suffix URLs are cached. 

Example content path :http//<domain-name>/a/b/c.html/d/e.html 

The suffix page /a/b/c.html/d/e.html is derived from the short URL /a/b/c.html and suffix elements in the URL path are supposed to be request parameters used in the short URL. Implementation is done in this way to make the suffix URL get cached on dispatcher . Here query parameters are not used since that makes the page not to be cached on dispatcher. But this approach is leading to a new bug  and we are getting 404 error for short URL (http//<domain-name>/a/b/c.html)

As we can see from the above this page gets cached since it has .html extension at the end. The caching of suffix URL causes a problem since A directory is created with c.html on dispatcher under the folder /a/b .

Hence when this page is requested http://<domain-name>/a/b/c.html user gets 404(resource not found) error.

Do we need change the approach that all suffix URLs should have a selector in the middle of the path where there is already a .html in the content path.

Example -->http://<domain-name>/a/b/c.selector.html/d/e/html so that if the the path of this long URL is totally different from the page http://<domain-name>/a/b/c.html

Since the current implementation is already there how can we resolve the 404 error that occurs for the short URL -->  http://<domain-name>/a/b/c.html

Is there any way we can enforce the suffix URL to have a selector as explained above without touching the component level code , that is by using a sling-filter.

0 Replies