KevinDockx / HttpCacheHeaders

ASP.NET Core middleware that adds HttpCache headers to responses (Cache-Control, Expires, ETag, Last-Modified), and implements cache expiration & validation models
MIT License
271 stars 57 forks source link

7.1.0 contains bug when HttpCacheExpiration and HttpCacheValidation attributes are applied on controller and on action #138

Closed ernestas20111 closed 3 months ago

ernestas20111 commented 8 months ago

This bug was probably introduced in 7.1.0 version.

If both - controller and action contain HttpCacheExpiration and HttpCacheValidation attributes with different values. Action for some reason inherits values set on controller and not on action. In other words, attributes applied to action do not take any effect, unless attributes are removed from controller level.

Note: In version 7.0.0 everything seems to be working as expected.

KevinDockx commented 7 months ago

Hmm, odd, something like that should've been caught by the unit tests. Thanks for letting me know, I'll have a look!

wsigel commented 4 months ago

I'm experiencing the same problem following the course on pluralsight using version 7.1.0 - switching to version 7.0.0 the settings on the action override the settings on the controller but then the cache isn't used even though cache control is set to: public,max-age=1000. There should be an age when sending the same request within the specified time span but there isn't.

KevinDockx commented 3 months ago

Fixed in 7.2.0