-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
clean up cache invalidation information on the cache chapter #4626
Conversation
$response = new Response(); | ||
if ($this->getStore()->purge($request->getUri())) { | ||
$response->setStatusCode(200, 'Purged'); | ||
} else { | ||
$response->setStatusCode(404, 'Not purged'); | ||
$response->setStatusCode(200, 'Not found'); |
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.
a matter of taste, but i think asking for something to be deleted that is not there should not be considered an error.
btw, what do you think of moving the section on cache invalidation right after cache validation? we explain expiration and validation, then comes totally different stuff, and at the end we go back to invalidation as a 3rd option to manage cache validity. |
Maybe move it after "Expiration and Validation"? |
updated.
exactly, i'd like to do that. the problem is that then the diff will not show what i changed in that section anymore. so i prefer to wait until the changes are considered ok, then i will move it up. |
Looks good given the weak caching knowledge I have. 👍 |
thanks. i guess i wait until @weaverryan confirms its ok and then move the section up and let him merge it. |
@@ -1063,9 +1069,15 @@ too far away in the future. | |||
if you don't worry about invalidation, you can switch between reverse | |||
proxies without changing anything in your application code. | |||
|
|||
Actually, all reverse proxies provide ways to purge cached data, but you |
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.
why removing this?
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.
you mean the note that a cache can be invalidated? i can see to make that clear again for people really not familiar with caches...
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.
rewrote the whole bit into a ..tip
to say don't use invalidation if you can avoid it.
@dbu 👍 from me - it reads really well, and I fully agree that we should be less negative and more pragmatic about cache invalidation. So, feel free to move this up further now - I appreciate you making my life easier :). Also, It may make sense to mention FOSHttpCacheBundle near the top of the cache invalidation section. I would hate for someone to have a perfect use-case for it, but then read along and implement their own logic before realizing this tool is available to help them. Thanks! |
okay, moved the section to the end of the "validation and expiration" section and the link to fos httpcache up earlier into that section. |
HTTP Expiration and Validation | ||
------------------------------ | ||
HTTP Expiration, Validation and Invalidation | ||
-------------------------------------------- |
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.
ok to change this section title?
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, as long as you make it BC. (so adding a .. _http-expiration-and-validation:
anchor
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, as long as you make it BC. (so adding a |..
_http-expiration-and-validation:| anchor
did that. looks a bit funny with the double anchor, however.
@@ -766,7 +776,7 @@ at some interval (the expiration) to verify that the content is still valid. | |||
annotations. See the `FrameworkExtraBundle documentation`_. | |||
|
|||
.. index:: | |||
pair: Cache; Configuration | |||
pair: Cache; Configuration |
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.
This should be reverted. We always use four spaces for indentation.
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.
i was looking at other files. http_fundamentals.rst for example is aligning on index::
as well, so they also have 3 spaces. as is the rest of this file.
good to merge? or any more feedback? |
👍 Looks ready to be merged. Happy new year @dbu! |
Thanks very much @dbu - this is clearly a big step forward. Cheers! |
…apter (dbu) This PR was merged into the 2.3 branch. Discussion ---------- clean up cache invalidation information on the cache chapter | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | - The documentation on active cache invalidation is overly negative. I tried to make it more neutral and point to FOSHttpCacheBundle for further information. Commits ------- 0accf63 cleanup cache book chapter 979034a move fos httpcache bundle tip up to beginning of invalidation section 2bddbb1 move invalidation up into expiration and validation section d4d2236 clean up cache invalidation information on the cache chapter
The documentation on active cache invalidation is overly negative. I tried to make it more neutral and point to FOSHttpCacheBundle for further information.