Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull requests separates the cache relevant methods into one class called
CacheHelper
. All classes are now under theSlim\Middleware
namespace.Overview of the classes:
CacheHelper
: Helper class with methods to set cache relevant headers and to determine if the client side cache is still valid. The methods can be used in the application (fixes Abort execution early if client side cache is still valid #10).CacheProvider
: Only adds aCacheHelper
object to the container (fixes Unbind the Service Provider from the main code #7).Cache
: Middleware to automatically set default cache headers and status code304
if necessary. Uses theCacheHelper
class to remove code duplication.The
CacheHelper
andCache
objects are independent, if you only want helper methods or only want to add default cache headers, you can do so.