and Weber, 2016), some of them also using machine
learning to enhance the already used ones (Ali et al.,
2012).
The effectiveness of caching is typically measured
in hit rate or byte hit rate. Hit rates are determined as
the percent of requests that could be satisfied directly
by the cache, while byte hit rate represents the per-
cent of the data (numbered in bytes) that were already
cached before answering the request (Nanda et al.,
2015), (Ma et al., 2018).
The majority of the developed solutions for web
caching are dedicated towards storing data generated
by a server. Few of them offer a solution for buffering
the incoming information that is meant to be stored
by the SQL/NoSQL database. Indeed, Redis, Mem-
cached, Apache Kafka, RabbitMQ and others offer
the possibility to achieve this goal, but it is done intru-
sively, meaning that the underlying main server needs
to suffer modifications to accommodate these solu-
tions. This paper approaches the implementation of
RcSys (Resource Caching System), a proxy / surro-
gate server specifically engineered to cache both in-
coming (upload) and fetched data in order to allevi-
ate the load across the network and database server.
The application uses multi-threading for request pro-
cessing and data buffering, implementing a one-tiered
cache replacement policy. Fundamental to our solu-
tion is the configuration file, where the administra-
tor can customize important aspects of the proxy like
maximum allocated disk memory, thread pool size,
cacheable paths (with support for regex), data valida-
tion, and more. After describing the architecture, we
will compare RcSys to Squid and observe the opti-
mization gains that it can bring.
The structure of the paper is divided into five
sections, the Introduction being followed by a short
presentation of Squid-cache in Materials and Meth-
ods. The Proposed System Architecture section is
the longest section, focusing on our main engineering
choices and their benefits. In Strengths and Short-
comings of the Solution section are highlighted the
conducted tests for comparing RcSys and Squid, how
the performance-related data was collected, and what
benefits RcSys offers, but also the downsides. In the
Conclusions section, we present this study’s findings
and the benefits it has yielded.
2 MATERIALS AND METHODS
Before delving into the construction and testing of
the proposed solution, it is imperative to provide an
overview of its counterpart. This would be Squid,
https://www.squid-cache.org/, a proxy server solution
that is most often used as a caching proxy. It is a pop-
ular application used for caching and managing both
static and dynamic content generated as a response
by a web server for a user’s request, supporting proto-
cols such as HTTP, HTTPS, FTP, and more. To save
bandwidth, speed up load times, and conserve com-
puting power, hundreds of Internet providers employ
Squid in addition to thousands of standalone websites,
as stated in the official documentation.
Squid is a battle-hardened application. It pro-
vides a powerful configuration file with the ability
to create very complex distributed caching infrastruc-
tures. It can deploy on multiple computers and create
a caching hierarchy consisting of Parents, Kids and
Coordinators, all communicating with each other for
better buffering and cache management to save band-
width, processing power and lower latencies. Be-
sides that, Squid also offers administrators the pos-
sibility to configure both Memory and Disk caches
independently, each with its own replacement policy
like LRU, heap GDSF, heap LFUDA, and heap LRU.
Trying to match the power that Squid provides
would be a very tedious and long process. Thus, we
will try to optimize only a small chunk of it. Our fo-
cus falls on how Squid handles requests that upload
data. As of now, Squid will redirect those to the main
server. This approach may be improved. Instead of
redirecting the request, we could extract the data (if its
URL is marked as cacheable in the configuration file)
and store it locally into a buffer till the caching time
expires, sending it all at once afterward. This way, if
the data is meant to be written in a relational database,
the time it takes to execute for a single, multiple rows
insertion query is far lower than overall multiple sin-
gle rows insertions. The following sections will ex-
plore the concept further and present a viable solu-
tion.
3 THE PROPOSED SYSTEM
ARCHITECTURE
The proposed application, referred to as RcSys (Re-
source Caching System), functions as a caching proxy
for handling both user upload and download requests.
Before a detailed technical examination of the sys-
tem’s architecture, a general schematic overview of
its operational flow will be presented.
The diagram from Figure 1 illustrates three pri-
mary actors: clients, the RcSys server, and the main
server. All communication between these compo-
nents occurs through HTTP(S). The interaction com-
mences as a client initiates a request over the inter-
net, either for uploading (e.g., sending emails, cre-
ICSOFT 2024 - 19th International Conference on Software Technologies
368