Download the PHP package qimnet/update-tracker-bundle without Composer
On this page you can find all versions of the php package qimnet/update-tracker-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download qimnet/update-tracker-bundle
More information about qimnet/update-tracker-bundle
Files in qimnet/update-tracker-bundle
Package update-tracker-bundle
Short Description QIMNET Update tracker bundle
License MIT
Homepage http://qimnet.com
Informations about the package update-tracker-bundle
Qimnet\UpdateTrackerBundle
This bundle is used to track updates on entites and cache results client side or server side according to the update times.
Configuration
An UpdateTracker
entity has to be added to the project to use the bundle.
The following code can be used :
The name of the entity should then be added to your config.yml file :
Tracking entity changes
To track the changes of a given entity, you have two choices :
- use the
Qimnet\UpdateTrackerBundle\Annotation\TrackUpdate
annotation on your entity class - implement
Qimnet\UpdateTrackerBundle\UpdateTracker\TrackUpdateInterface
in your entity class
The changes can then be tracked using the qimnet.update_tracker.manager
service.
Using HTTP cache validation
To generate HTTP responses and use HTTP cache validation, use the
qimnet.update_tracker.http_cached_response_factory
service :
Using timestamps in Urls
Timestamped URL are useful for using HTTP cache expire headers with dynamic content. This can be useful for :
- content which can afford to have a changing URL
- ESI
To use timestamped URLs in your twig templates, use the timestamped_path
,
timestamped_url
and timestamped_controller
functions.
Here is an example of this type of caching strategy with an ESI :
Using server side caching
To use server side caching, enable the cache manager in your configuration file :
You can then request cached object using the qimnet.update_tracker.cache_manager
service :
You can also render cached fragments directly from yout templates by using the
render tag with the cache
strategy :
Cache entries are automatically deleted when the corresponding update tracker namespace is changed.