{"action":"created","issue":{"url":"https://api.github.com/repos/md-systems/redirect/issues/7","labels_url":"https://api.github.com/repos/md-systems/redirect/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/md-systems/redirect/issues/7/comments","events_url":"https://api.github.com/repos/md-systems/redirect/issues/7/events","html_url":"https://github.com/md-systems/redirect/issues/7","id":58230079,"number":7,"title":"RedirectTerminateSubscriber::onKernelTerminateLogRedirect() invalidates cache tags and entity storage every time a redirect is usd","user":{"login":"Berdir","id":40826,"avatar_url":"https://avatars.githubusercontent.com/u/40826?v=3","gravatar_id":"","url":"https://api.github.com/users/Berdir","html_url":"https://github.com/Berdir","followers_url":"https://api.github.com/users/Berdir/followers","following_url":"https://api.github.com/users/Berdir/following{/other_user}","gists_url":"https://api.github.com/users/Berdir/gists{/gist_id}","starred_url":"https://api.github.com/users/Berdir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Berdir/subscriptions","organizations_url":"https://api.github.com/users/Berdir/orgs","repos_url":"https://api.github.com/users/Berdir/repos","events_url":"https://api.github.com/users/Berdir/events{/privacy}","received_events_url":"https://api.github.com/users/Berdir/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-19T16:19:53Z","updated_at":"2015-03-02T20:13:17Z","closed_at":null,"body":"I'm not sure yet where this information should be stored, but doing it through entity->save() is bad for multiple reasons:\r\n\r\n- A save invalidates the storage cache\r\n- It also invalidates the redirect:$id and redirect_list cache tags, which aren't actually used, which results in two additional sql queries (updating the checksum table), and possibly notification of external caching system which also means that a cache redirect would be invalidated again immediately after caching it, every time.\r\n\r\nTwo ways to fix this:\r\n1. add a new method on the storage handler specifically for this, which would at least avoid the cache tags, but we still have to invalidate the storage cache to get updated results in e.g. views (query would work, though)\r\n2. Store it somewhere else, but it still needs to be possible to query it.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/md-systems/redirect/issues/comments/76805529","html_url":"https://github.com/md-systems/redirect/issues/7#issuecomment-76805529","issue_url":"https://api.github.com/repos/md-systems/redirect/issues/7","id":76805529,"user":{"login":"Berdir","id":40826,"avatar_url":"https://avatars.githubusercontent.com/u/40826?v=3","gravatar_id":"","url":"https://api.github.com/users/Berdir","html_url":"https://github.com/Berdir","followers_url":"https://api.github.com/users/Berdir/followers","following_url":"https://api.github.com/users/Berdir/following{/other_user}","gists_url":"https://api.github.com/users/Berdir/gists{/gist_id}","starred_url":"https://api.github.com/users/Berdir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Berdir/subscriptions","organizations_url":"https://api.github.com/users/Berdir/orgs","repos_url":"https://api.github.com/users/Berdir/repos","events_url":"https://api.github.com/users/Berdir/events{/privacy}","received_events_url":"https://api.github.com/users/Berdir/received_events","type":"User","site_admin":false},"created_at":"2015-03-02T20:13:17Z","updated_at":"2015-03-02T20:13:17Z","body":"Maybe also re-think/fix the caching relation options, there's quite some not-working/commented out code, like a check for a non-existing invoke_hooks setting on the purge options.\r\n\r\n8.x actually caches responses by default, didn't check yet, but it likely just works for redirects unless we explicitly disable it. And using cache tags, we can also make invalidation of it work."}}