symfony1 icon indicating copy to clipboard operation
symfony1 copied to clipboard

Fix compatibility with HTTP specs about cacheable status codes and methods

Open alquerci opened this issue 7 years ago • 12 comments

Fixes: #199

  • [x] Add pages with status codes 200, 203, 300, 301, 302, 404, 410 to cache.
  • [x] Add to cache response from HEAD method request.

alquerci avatar Oct 19 '18 12:10 alquerci

@j0k3r @GromNaN Can you look for this patch?

I provided all required tests for it.

alquerci avatar Oct 25 '18 10:10 alquerci

@GromNaN Thank you for your time and to take care of this.

alquerci avatar Oct 26 '18 09:10 alquerci

Not something I am willing to merge. We are going to archive this repository #102.

GromNaN avatar Oct 26 '18 12:10 GromNaN

Noted, then the goal will be to find a new repository based on this version and able to maintain using almost same quality as Symfony.

As I see on the discussion #102 there are many forks but we only need one.

The goal of this patch is to avoid adding another fork.

The goal of this project is to give the ability to migrate the most smooth to Symfony4+. The introduction of the service container was a good things and the first step. The next step is to use Symfony4+ DIC.

alquerci avatar Oct 26 '18 12:10 alquerci

Hello @thePanz @mkopinsky

Can you take a look at this patch?

alquerci avatar Oct 29 '18 16:10 alquerci

My point of view on pushing this repo further is to remove code instead of writing more. View caching, for example, should be completely unloaded from the framework to a specialized tool like Varnish.

e1himself avatar Oct 30 '18 09:10 e1himself

Hello @e1himself

Indeed, but I proposed this patch because it fix a business issue.

alquerci avatar Oct 30 '18 09:10 alquerci

@e1himself What do you think if we add a configuration parameter to activate this patch (to minimize any BC breaks)?

Sometimes a bug can be a feature.

alquerci avatar Nov 09 '18 11:11 alquerci

What do you think if we add a configuration parameter to activate this patch (to minimize any BC breaks)?

If you ask me, I'd say this fix should live in your codebase as a set of stock framework classes overrides. You can do that with factories.yml (even though it'll require quite lots of overrides).

I believe we should not bring new features into this repo.

But I'm neither owning nor maintaining this repo. Thus it's just an opinion.

e1himself avatar Nov 09 '18 11:11 e1himself

@e1himself Thank you for your feedback.

This PR exists because there is no way to provide this patch as a set of stock framework classes overrides.

This PR provide a bug fix for HTTP spec.

Your message is a bit confusing as you start to discuss about a fix, but you finish your message as a feature.

alquerci avatar Nov 09 '18 16:11 alquerci

@alquerci

Hey Alexandre,

... because there is no way to provide this patch as a set of stock framework classes overrides.

I might be wrong, but I see nothing preventing this.

Your message is a bit confusing as you start to discuss about a fix, but you finish your message as a feature.

Yes, you're right. I've used inaccurate wording :) Technically this is a bug fix. But I wanted to say that this PR is bringing something new. Even if it's a missing aspect of an existing feature.

Again, it's not me who should decide on whether this should be merged or not :)

Cheers.

e1himself avatar Nov 26 '18 09:11 e1himself

Hi Ivan,

Again, it's not me who should decide on whether this should be merged or not :)

@e1himself Indeed, but as open-source project the point of view of any code reviewer can be taken account.

As you shared your point of view it means that you are involved on the project. And just for that, thank you.


Aside I am agreed with you about:

View caching, for example, should be completely unloaded from the framework to a specialized tool like Varnish.

However for a project where there are more than 10 million of landing pages on cache. What is the best solution between :

  1. Migrate the fully cache system to Varnish or other system
  2. Contribute to the framework to provide the patch to share it to other users using the view_cache.
  3. Fork the framework and apply the patch, but closing door to open-source community (the company have not enough resources to maintain a custom version).

While solutions first and second are relatively reasonable the third is something to avoid if we want to have a useful @FriendsOfSymfony1 community (at least until the last sf1 project will migrate)


I think that such discussion is very constructive for the mindset of @FriendsOfSymfony1 community.

cc @thePanz

alquerci avatar Nov 26 '18 13:11 alquerci