INNER CODE UNIT · Python

__call__

ArcReel/ArcReel · server/app.py:750

    async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
        if scope["type"] != "http":
            await self.app(scope, receive, send)
            return

        async def send_wrapper(message: Message) -> None:
            if message["type"] == "http.response.start":
                headers = MutableHeaders(scope=message)
                if headers.get("content-type", "").lower().startswith("text/html"):
                    headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0"
            await send(message)

        await self.app(scope, receive, send_wrapper)


app.add_middleware(SPAShellNoCacheMiddleware)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…