Codoforum related discussions
Why Codoforum duplicates the post content in imessage?

Is it harmful to duplicate the post content in both
<div class="codo_posts_post_message">
and
<div class="codo_posts_post_imessage">

Why should Codoforum do that?

Is it harmful to duplicate the post content in both `&amp;lt;div class=&quot;codo_posts_post_message&quot;&amp;gt;` and `&amp;lt;div class=&quot;codo_posts_post_imessage&quot;&amp;gt;` Why should Codoforum do that?
NguoiAnPhu.com Powered by Codoforum 4.3 (https://github.com/nguoianphu/codoforums-vietnam).

Hi,

It is for performance reasons.

One is an unformatted message that contains markdown or bbcode
and the other one is its HTML equivalent.

Hi, It is for performance reasons. One is an unformatted message that contains markdown or bbcode and the other one is its HTML equivalent.

Hi @adesh ,

I knew it. But we only need it when editing the post. It rarely happens.
Why don't you query database to get the <div class="codo_posts_post_imessage"> when only user click on the edit button?

Hi @adesh , I knew it. But we only need it when editing the post. It rarely happens. Why don&#039;t you query database to get the `&amp;lt;div class=&quot;codo_posts_post_imessage&quot;&amp;gt;` when only user click on the edit button?
NguoiAnPhu.com Powered by Codoforum 4.3 (https://github.com/nguoianphu/codoforums-vietnam).

Hi,

Yes, we could do that, but we wanted the edit option to not have any lags due to slow response from server.

If we query from the database, the user will see a blank screen in the edit form for almost 1 second which we wanted to avoid.

But, after giving your reply a thought, we thought of this:

To edit a post, a user needs two clicks, that is first click the "three dots" at the top right of a post, then click on edit link.

So, what we can do is, on the first click, prefetch the post content from database.

What do you think about this ?

Hi, Yes, we could do that, but we wanted the edit option to not have any lags due to slow response from server. If we query from the database, the user will see a blank screen in the edit form for almost 1 second which we wanted to avoid. But, after giving your reply a thought, we thought of this: To edit a post, a user needs two clicks, that is first click the &quot;three dots&quot; at the top right of a post, then click on edit link. So, what we can do is, on the first click, prefetch the post content from database. What do you think about this ?

Well, it's nice. I posted many long posts into my forum and it's slow to display. Not sure if it hurts the SEO (duplicated content).

But I think its priority is low smile. Please process it when you have time.

Well, it&#039;s nice. I posted many long posts into my forum and it&#039;s slow to display. Not sure if it hurts the SEO (duplicated content). But I think its priority is low :). Please process it when you have time.
NguoiAnPhu.com Powered by Codoforum 4.3 (https://github.com/nguoianphu/codoforums-vietnam).
edited May 4 '15 at 8:32 am

I'm not sure this is a good solution. smile

Why waste space in the database for the same message twice?

This should done by HTML parser (or any other markup parser) in real time, without duplication of text.

This process can be done through Ajax almost immediately (without query database, similiar like live preview).

After all why use a markup language, when it can be added wysiwyg editor?
I personally was even more comfortable with BBCode than this markup language.

I&#039;m not sure this is a good solution. :) Why waste space in the database for the same message twice? This should done by HTML parser (or any other markup parser) in real time, without duplication of text. This process can be done through Ajax almost immediately (without query database, similiar like live preview). After all why use a markup language, when it can be added wysiwyg editor? I personally was even more comfortable with BBCode than this markup language.

We save the message twice because it saves processing in the server side.

And if this processing is deferred to client side, then the pages will load slowly.

We wanted to avoid writing parsers for both server side and client side.

We save the message twice because it saves processing in the server side. And if this processing is deferred to client side, then the pages will load slowly. We wanted to avoid writing parsers for both server side and client side.

@castbound ,

I personally love markdown and don't like BBCODE smile.

@adesh ,

Currently, the page will load very fast when I editing post. But it will also load slowly when the fisrt time I load the page smile.

I'm realy like your solution!

To edit a post, a user needs two clicks, that is first click the "three dots" at the top right of a post, then click on edit link.
So, what we can do is, on the first click, prefetch the post content from database.

@castbound , I personally love markdown and don&#039;t like BBCODE :). @adesh , Currently, the page will load very fast when I editing post. But it will also load slowly when the fisrt time I load the page :). I&#039;m realy like your solution! &amp;gt; To edit a post, a user needs two clicks, that is first click the &quot;three dots&quot; at the top right of a post, then click on edit link. So, what we can do is, on the first click, prefetch the post content from database.
NguoiAnPhu.com Powered by Codoforum 4.3 (https://github.com/nguoianphu/codoforums-vietnam).
edited May 9 '15 at 7:32 am

Query 2 fields with large post will not save anything smile In fact it will slow down page loading (client side - lot's of HTML code + Server side 2 fields with large text). Now imagine lot's of posts with lot's of text...

If you want to boost performance you should look at database structure. Missing lot's of indexes. Try to enable slow queries logs and queries without indexes to see what's going on with database smile This will really boost perfomance a lot and should be known to any developer. smile

@nguoianphu well, wysiwyg editor is even better.

Query 2 fields with large post will not save anything :) In fact it will slow down page loading (client side - lot&#039;s of HTML code + Server side 2 fields with large text). Now imagine lot&#039;s of posts with lot&#039;s of text... If you want to boost performance you should look at database structure. Missing lot&#039;s of indexes. Try to enable slow queries logs and queries without indexes to see what&#039;s going on with database :) This will really boost perfomance a lot and should be known to any developer. :) @nguoianphu well, wysiwyg editor is even better.
302
8
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft