Problem/Motivation

The page cache id could be long, as the URL might be over 256 characters which were previously possible with the database cache backend.

This was however changed, the cid is automatically and more intelligently (the first part of the cid is kept) hashed.

Proposed resolution

Remove the call to sha1().

Advantage:
- We save a sha1() for all urls + content type < 256 character
Debugging the page cache is easier

Remaining tasks

User interface changes

API changes

Comments

wim leers’s picture

Issue tags: +php-novice, +D8 cacheability, +DX (Developer Experience)
rpayanm’s picture

Status: Active » Needs review
StatusFileSize
new435 bytes

Let's me try :)

Status: Needs review » Needs work

The last submitted patch, 2: 2386255-2.patch, failed testing.

berdir’s picture

PageCacheTagsTestBase has a sha1() call too, removing that should fix all the CacheTagsTests. BlockTest might have one too.

aneek’s picture

StatusFileSize
new3.41 KB
new3.84 KB

@rpayanm,
There are more files that depends on removal of SHA1 as suggested by @Berdir.

/Core/modules/block/src/Tests/BlockTest.php
/Core/modules/system/src/Tests/Bootstrap/PageCacheTest.php
/Core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
/Core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php

Just uploading a patch removing these. Please fix if I've missed something.

aneek’s picture

Status: Needs work » Needs review
wim leers’s picture

Status: Needs review » Reviewed & tested by the community

Looks great, thanks!

rpayanm’s picture

@Berdir @aneek Thank you for you explanation :)

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.0.x, thanks!

  • catch committed 6414318 on 8.0.x
    Issue #2386255 by aneek, rpayanm: Remove explicit sha1() call in...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.