OWASP-BLT / BLT

OWASP BLT is a bug logging tool to report issues and get points, companies are held accountable.
https://blt.owasp.org
GNU Affero General Public License v3.0
122 stars 125 forks source link

update the cacheing #2396

Closed JisanAR03 closed 1 week ago

JisanAR03 commented 1 week ago

@arkid15r sir, can you please check this commit . update the caching

DonnieBLT commented 1 week ago

I think it is good to cache anonymous users, it speeds up the homepage significantly. What is the issue?

arkid15r commented 1 week ago

There is a standard Django way to cache a page. In newhome there is some extra logic for authenticated users email check/verification that can be a middleware and cover all routes instead of just the home page.

DonnieBLT commented 1 week ago

Cool, well I'm fine having it only on the homepage. I feel like if it's a middleware, we will have to check all the routes and api. The main issue we are solving is the slow homepage load. I'm open to any solution for that.

JisanAR03 commented 1 week ago

@arkid15r , any suggestion for me ?

arkid15r commented 1 week ago

The point of not having authenticated user related logic is that we could use cache_page freely -- the content would be the same for everyone.

Also it may be a good idea to start from the other end in terms of page loading optimization -- index Issue::is_hidden or Point::created or make other changes to speed up the view logic.

arkid15r commented 1 week ago

@arkid15r , any suggestion for me ?

No, not at this time. I believe it's better to leave it for review to @DonnieBLT

JisanAR03 commented 1 week ago

@arkid15r ok sure. and also with that I can optimize the home page to . so I'm thinking to create a issue and start optimize the home page .

@DonnieBLT sir , should i do that ? and can you please review this PR too.

DonnieBLT commented 1 week ago

Sorry, I'm not sure what the issue is that this PR is solving. I first tried full page caching and then realized that each user has a different view. Ideally, we could have full page caching and then rewrite sections like the user icon or specific user issues using JavaScript but I thought I came up with a quick solution, just using the user session as the cache key it seems to be working OK for me. I'm not sure what problem we ran into. Is this more of an architecture design change or did we run into a specific bug?

JisanAR03 commented 1 week ago

@DonnieBLT , now this PR is just update the login cache,.. if user trigger "signin, signout , or logout " any of this ,, my last pr was clear all the cache now this PR only clear the login related cache

DonnieBLT commented 1 week ago

Awesome thanks! Feel free to create another issue to address the other concerns.

JisanAR03 commented 1 week ago

Awesome thanks! Feel free to create another issue to address the other concerns.

@DonnieBLT Thank you so much