FOUR-20944: Implement ETag Caching for Task and Case Data by eiresendez · Pull Request #7786 · ProcessMaker/processmaker

added 6 commits

December 2, 2024 11:05
…on to prevent ETag inconsistencies
- Process only GET and HEAD methods to ensure middleware relevance and avoid unnecessary processing for non-cacheable HTTP methods.
- Add a check to determine if the response is cacheable, filtering out non-cacheable responses (e.g., those with 'no-store' directive or non-cacheable status codes).
- Default ETag generation now includes user-specific data (auth()->id()) to enforce personalized caching by default.
- Removed 'scope' and 'includeUser' logic for simplified and consistent caching behavior.
- Refactored `EtagManager` to support dynamic ETag generation based on configurable sources (`updated_at`).
- Introduced `generateEtagFromTables` with a `source` parameter for flexibility in determining the source of truth.

This update prepares the app for future scalability and allows switching between different ETag generation strategies.

estebangallego

@eiresendez

- Applied ETag middleware to the 'startProcesses' route for improved caching and reduced payload size.
- Added default 'etag_tables' parameter set to 'processes' to optimize ETag generation for this route.

estebangallego