MCPcopy Create free account
hub / github.com/apache/trafficserver / Caching

Class Caching

include/cripts/Bundles/Caching.hpp:30–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28namespace cripts::Bundle
29{
30class Caching : public cripts::Bundle::Base
31{
32 using super_type = cripts::Bundle::Base;
33 using self_type = Caching;
34
35public:
36 using super_type::Base;
37
38 // This is the factory to create an instance of this bundle
39 static self_type &
40 _activate(cripts::Instance &inst)
41 {
42 auto *entry = new self_type();
43
44 inst.AddBundle(entry);
45
46 return *entry;
47 }
48
49 [[nodiscard]] const cripts::string &
50 Name() const override
51 {
52 return _name;
53 }
54
55 self_type &
56 cache_control(cripts::string_view cc, bool force = false)
57 {
58 NeedCallback(cripts::Callbacks::DO_READ_RESPONSE);
59 _cc = cc;
60 _force_cc = force;
61
62 return *this;
63 }
64
65 self_type &
66 disable(bool disable = true)
67 {
68 NeedCallback(cripts::Callbacks::DO_REMAP);
69 _disabled = disable;
70
71 return *this;
72 }
73
74 void doReadResponse(cripts::Context *context) override;
75 void doRemap(cripts::Context *context) override;
76
77private:
78 static const cripts::string _name;
79 cripts::string _cc = "";
80 bool _force_cc = false;
81 bool _disabled = false;
82};
83
84} // namespace cripts::Bundle

Callers

nothing calls this directly

Calls 1

AddBundleMethod · 0.80

Tested by

no test coverage detected