Implement server-side response cache
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- php
- Domain
- api, backend, performance
Research direction
No files, tests, or entry points are named. Start by clarifying the cache scope, conditional-request behavior, provider interface, and supported backends, then trace the REST endpoint flow where responses and ETags are handled. Done means an agreed design and implementation plan with provider coverage and conformance tests defined.
Written by the indexing model from the issue text.
Description
This is a topic I've been burning to raise but there are still features required that takes a higher priority than this. Since the RESTful API architecture involves extensive CACHE considerations there is not much need to further motivate the benefit of having a properly implemented CACHE solution at the end-point, aside from the obvious performance and load shedding advantages, to be able to verify and test conformance of the developed REST implementation without the need for external CACHE providersp
It is only until now that we are discussing conditional requests that this has become pertinent as the framework will see a huge benefit if it is able to cache and make request provisioning decisions based on cached variants rather than re-requesting the Routers to populate a response on every request. for state information.
2616 allows for ETag to be used as an "opaque" identifier instead of dates:
The ETag response-header field value, an entity tag, provides for an "opaque" cache validator. This might allow more reliable validation in situations where it is inconvenient to store modification dates, where the one-second resolution of HTTP date values is not sufficient, or where the origin server wishes to avoid certain paradoxes that might arise from the use of modification dates.
Although I this will not be sufficient as the only identifier and we will benefit from having an additionally indexed key when ETag is not available, based on a calculated checksum of the following HTTP artifacts:
(Of the top of my head this will have to be verified)
-
location
-
accept header
-
method
In the interim it is safe to speculate that we would consider plug-able cache provisioning utilizing some/all of the following :
-
via file cache - simple and free from dependencies utilizing PHPs file_put/file_get_contents();
-
via PDO as database driven cache
-
via APC provisioned
-
via REDIS provisioned
-
via Memcache provisioned
-
via APC provisioned
-
via Solr provisioned
-
via ElasticSearch provisioned
-
via Reverse Proxy (Squid probably) provisioned (not sure if this is exactly what we have in mind though.
Aside from the obvious requirement that the design should be flexible to easily cater for additions to this list of providers I would additionally see the functionality being transparently exposing an API that can be utilized by other components of the application where this functionality may be required without impacting the core cache.
What are your thoughts?
- Dominant language
- PHP
- Stars
- 605
- Forks
- 100
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Respect/Rest
-
Project Status Open
Difficulty 5/5 Over a week Newbie friendliness 10/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
-
New Roadmap Open
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getgrav/grav-plugin-api#45 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RSS-Bridge/rss-bridge#5098 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
phingofficial/phing#2025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
silverstripe/developer-docs#911 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100