Closed josunedesosa closed 8 years ago
I believe that the problem is within constructor of InvalidateCacheOutputAttribute:
public InvalidateCacheOutputAttribute(string methodName, Type type = null)
{
this._controller = type != (Type) null ? type.Name.Replace("Controller", string.Empty) : (string) null;
this._methodName = methodName;
}
Should be:
public InvalidateCacheOutputAttribute(string methodName, Type type = null)
{
this.controller = type != (Type)null ? type.FullName : (string)null;
this.methodName = methodName;
}
Fixed in #162
this is now on nuget https://www.nuget.org/packages/Strathweb.CacheOutput.WebApi2/0.10.0
I have a problem with "InvalidateCacheOutput" header. I have two controllers: TipoDatosController y ValorDatosController.
1) TipoDatosController: I have this method:
2) ValorDatosController: when I post a new valor with next method, I want to invalidate the cache of "GetValorDatos" in "TipoDatosController"
I put the following notation but does not work: [InvalidateCacheOutput("GetValorDatos", typeof(TipoDatosController))]
How can do this with InvalidateCacheOutput header??
If I use a manual invalidation, it works.:
var cache = Configuration.CacheOutputConfiguration().GetCacheOutputProvider(Request); cache.RemoveStartsWith(Configuration.CacheOutputConfiguration().MakeBaseCachekey((TipoDatosController t) => t.GetValorDatos(valor.Id)));
Thanks a lot,
Josune