This pull requests separates the cache relevant methods into one class called CacheHelper. All classes are now under the Slim\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 #10).
CacheProvider: Only adds a CacheHelper object to the container (fixes #7).
Cache: Middleware to automatically set default cache headers and status code 304 if necessary. Uses the CacheHelper class to remove code duplication.
The CacheHelper and Cache objects are independent, if you only want helper methods or only want to add default cache headers, you can do so.
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 #10).CacheProvider
: Only adds aCacheHelper
object to the container (fixes #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.