Open bcoles opened 8 years ago
Good points @bcoles , I shall have a look at it and fix it soon (max during this weekend) ;-)
Added BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind_cached
as a temporary workaround in 4e741a067b141dc833d4a513af5335113ea82e85
@bcoles your workaround seems like a valid solution and has functioned well for 5 years. Any issue with me closing this?
@bcoles your workaround seems like a valid solution and has functioned well for 5 years. Any issue with me closing this?
The temporary workaround is a lazy hack.
You're too harsh :)
Currently
BeEF::Core::NetworkStack::Handlers::AssetHandler
has no caching capabilities.From a brief look over the code base it appears as though every instance of this function is used to mount a static resource. (The IPEC junk calculator may be an exception).
In the short term, setting a default expiry time of one hour (for example) would be a simple change. Developers could opt out of caching using a new Boolean false argument to
BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind
if needed.An even quicker and lazier option would be to duplicate the bind method solely for the purposes of implementing a new method like
bind_cachable
.Eventually, calls to
BeEF::Core::NetworkStack::Handlers::AssetHandler.instance.bind
should be able to specify HTTP headers to return (ie,Expires
) or set an expiration date in a parameter.@antisnatchor thoughts?