-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to set cache-control per extension type #1200
Comments
Hi @ericxin1982, One way to achieve this would be to use Pode's Endware, assuming this is static content, you could create an Endware which pattern matches against the supplied Path: Add-PodeEndware -ScriptBlock {
if ($WebEvent.Path -ilike '*.html') {
Set-PodeHeader -Name 'Cache-Control' -Value '<value>'
}
} Hope that helps :) |
That is so great, thanks. |
Hi @ericxin1982, Are you able to show a code example of what you have? Called |
Let me modify the sample to include the issue |
I set one cache-control in middleware, and set one in endware, and the endware would overwrite the previous setting. I do not have to have two cache-control, but I just showed you IIS would have two or multiple but pode just can have one only. Thanks |
Hi @ericxin1982, Ah right I see, so you want two. In which case using |
Got it. |
[### Question
A clear and concise description of your question.
]
(https://stackoverflow.com/questions/32987486/iis-setting-cache-control-header-per-file-type)
Is it possible to achieve this as well?
Thanks
Eric Xin
The text was updated successfully, but these errors were encountered: