-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cache tagging] http_resp_hdr_len check #273
Conversation
*/ | ||
$tagsize = max(array_map('mb_strlen', $escapedTags)); | ||
$elems = floor($this->headerLength / ($tagsize - 1)) ? : 1; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could do } else { $elems = count($escapedTags); }
and then have the foreach outside the if/else, to avoid the 3 redundant lines of code in the else below.
that should not cost much extra processing power, and avoids code duplication. there would be only one chunk so the foreach would only be executed once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about this idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, makes sense!
08beb81
to
0628c11
Compare
looks good, thanks a lot! can you please add a note in the CHANGELOG.md file? |
0628c11
to
1ea0cf7
Compare
done |
you think those travis errors related to this pull request? |
[cache tagging] http_resp_hdr_len check
thanks! the test failure looks unrelated indeed. seems our way of starting servers has become unreliable somehow. do you want to have a go at porting things to master? creating a branch from 1.4 and do a PR to master from that branch. |
i released https://github.com/FriendsOfSymfony/FOSHttpCache/releases/tag/1.4.2 with this fix. |
ok, will have a go at merging 1.4 into master |
fixes #269
notes:
getTagsHeader
andsetTagsHeader
are marked as depricated in theCacheInvalidator
i didn't provide seperate functions for theheaderLength
.http_resp_hdr_len
defaults to 8000 bytes, i defaulted theheaderLength
to 7500 bytes to be on the safe side