Skip to content
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

Option to permanently parse mentions to reduce site load to a minimum #10

Open
Wolfsblvt opened this issue Feb 5, 2015 · 3 comments
Open
Assignees
Milestone

Comments

@Wolfsblvt
Copy link
Owner

On huge boards or boards with low ressources the parsing that is done for every post everytime it is loading takes quite a lot time.

So the idea was to reduce this load to a minimum with parsing the posts one time on post submit and store the parsed version in the database.
This would make it permanent, wich would lead so some problems (addressed here: https://www.phpbb.com/community/viewtopic.php?p=13936311#p13936311) that should be reduced to a minimum to keep the data consistent.

@Wolfsblvt Wolfsblvt self-assigned this Feb 5, 2015
@Wolfsblvt Wolfsblvt added this to the 1.1.0 milestone Feb 5, 2015
@gn36
Copy link

gn36 commented Feb 5, 2015

You could actually, instead of modifying the post, introduce a new table "phpbb_mentions" for this, linking the mentioned user_ids and the post_ids (and/or topic_ids).

Then instead of generating a whole list each time of displaying, you can simply check for the post IDs you need in that table and fetch only the necessary user information on display. It should be possible to integrate this on the SQL you already need for fetching the data anyways, since you can always simply fetch all posts displayed at once.

This will not completely solve the problem of changed username (since during replace, you won't recognize the old username which is still in the post anymore), but it will make it possible to remove all data of this extension from the database easily. If you want to keep linking the old username, you will need to store the old username as well to be able to replace it.

Another solution of the second problem would be reparsing all posts, which is not really desirable.

@Wolfsblvt
Copy link
Owner Author

Interesting idea too.then I would possibly just store the important data from the get_mentioned_users() function, so type, start and length and the user_id, so I could simply query the needed data for the parser.

I still need to parse then, but it would be much faster, I guess (?)

The problem with changed usernames is not a real problem for me. I don't think it is needed to come up with a solution there. As I've already posted in the topic on phpbb.com, it's the same with quotes by phpBB, wich aren't handled different, so the old name wouldn't match when it is changed.

Or wait. if I store the user_id, I will get the correct mention, won't I?

@Wolfsblvt Wolfsblvt reopened this Feb 6, 2015
@gn36
Copy link

gn36 commented Feb 6, 2015

You will get the correct new username, but you will loose all old mentions when the name changes, because you will search for the new name which can't be found in old posts.

I don't think there is a best solution for that problem, at least removing the data will work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants