Review main Merged

9266[FEATURE] Add clearing cache by tag and by identifier clearCacheCMD

Fabrizio Branca CR +2 V +2 Normal +47 −19 updated 06/03/13, 20:49

Commit message

The caching framework supports to remove cache entries by identifier
and by id. If this was supported by the t3lib_tcemain->clear_cacheCmd(),
this feature could also be used in TSConfig's TCEMAIN.clearCacheCmd.

As both require an additional parameter I suggest a syntax like this:

TCEMAIN.clearCacheCmd = cacheTag:firsttag,cacheTag:secondtag
TCEMAIN.clearCacheCmd = cacheId:first,cacheId:anotherid

Review

  • Code review CR +2
    • Tolleiv Nietsch +2
    • Jigal van Hemert +1
  • Verified V +2
    • Tolleiv Nietsch +2
    • Jigal van Hemert +1

Files 1

Review log 18

  1. Tolleiv Nietsch merged patch set 1 02/28/12, 22:47

  2. Tolleiv Nietsch uploaded patch set 2 02/28/12, 22:47

  3. Tolleiv Nietsch commented on patch set 2 02/28/12, 22:47

    Verified; Looks good to me, but someone else must approve
  4. Fabrizio Branca commented on patch set 2 02/28/12, 22:47

    (2 inline comments) See inline comments.
  5. Fabrizio Branca uploaded patch set 3 02/28/12, 22:47

  6. Fabrizio Branca uploaded patch set 4 02/28/12, 22:47

  7. Jigal van Hemert commented on patch set 2 02/28/12, 22:47

    I would prefer that you didn't submit this One question which needs some thought. I won't be able to push a new version tonight.

    class.t3lib_tcemain.php:6753

    The switch uses strtolower(), this case will never match...

    class.t3lib_tcemain.php:6762

    If the following checks don't result in some items to be flushed initializing these two caches is a waste of resources. Wouldn't it be better to first collect page(Section)Cache tags and IDs to be flushed and then initialize the caches if necessary?
  8. Tolleiv Nietsch commented on patch set 5 V 0 02/28/12, 22:47

    by team member; Looks good to me, approved
  9. Christian Kuhn commented on patch set 5 02/28/12, 22:47

    Guys. I understand your stdWrap patches and like them. The 5 patches give a nice feature set and are ok. There is just one thing with this patch here: There should imho be no need to drop by identifier, but by tag only. The identifier should not be known to integrators, it should be handled by the application and should be internal. If an entry must be dropped, it should be tagged accordingly. Thus I'd propose to change this patch and remove the cacheId handling.
  10. Jigal van Hemert commented on patch set 5 02/28/12, 22:47

    Verified; Looks good to me, but someone else must approve
  11. Jigal van Hemert uploaded patch set 5 02/28/12, 22:47

  12. Philipp Gampe commented on patch set 5 02/28/12, 22:47

    @Christian, if used together with the stdWrap.cache, then you can just drop by identifier if you use the same cache object on multiple pages. It might not be clean from a conceptual point of view, but a non-coder integrator will ask my he has to copy the identifier to tags in order to be able to flush the cache entry. This would make life for integrators harder.
  13. Mr. Jenkins commented on patch set 1 02/28/12, 22:47

  14. Mr. Jenkins commented on patch set 2 02/28/12, 22:47

  15. Mr. Jenkins commented on patch set 3 02/28/12, 22:47

  16. Mr. Jenkins commented on patch set 4 02/28/12, 22:47

  17. Mr. Jenkins commented on patch set 5 02/28/12, 22:47

  18. Fabrizio Branca commented on patch set 5 02/28/12, 22:47

    Actually Christian is right. i only added this for feature completeness, but I can also be perfectly removed as we should never have to know anything about speficic cache_page identifiers. @Philipp: The stdWrap.cache feature you're referring to (where you actuelly not only can but also must define the key/identifier) stores its content into cache_hash and not cache_pages. Cache_hash entries cannot be flushed by tag or removed by identifier inside clearCacheCMD anyways as this only operates on the page cache stored in cache_pages. So if it feel cleaner to anybody, I'm perfectly ok with removing the clear by id feature (as long as the clear by tag feature stays:)