beefproject / beefproject/beef

Augment AssetHandler.instance.bind to allow asset caching

Open
#1,245 5 comments 0 reactions 0 assignees View on GitHub
Low
Dominant language
JavaScript
Stars
11k
Forks
2.4k
Avg merge
1d 1h
Merged PRs (30d)
15

Description

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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.