user20271414
user20271414

Reputation: 13

Spartacus - SSR - express engine renders image requests

recently I've noticed that express engine in Spartacus app tries to render images.

SSR log:

SSR rendering exceeded timeout 5000, fallbacking to CSR for /medias/images/1123123123.jpg

Is this normal, or something is wrong with our app?

Upvotes: 1

Views: 182

Answers (1)

Krzysztof Platis
Krzysztof Platis

Reputation: 1221

It’s not normal. According to the common express.js routing rules in Spartacus apps, when the pattern *.* (file with an extension) is not able to find a static file of a given URL on the server, it tries next routing rule (aka middleware) - which is the Angular renderer.

So I guess the problem in your case might be caused by missing static files on your express.js server.

If you want to return 404 in case of missing static file, instead of falling back to the next routing rule, you might consider using the option fallthrough:false of express.static.

Upvotes: 2

Related Questions