Caching the Description, best MySQL Field Type?

Avatar image for claiver
claiver

16

Forum Posts

14

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#1  Edited By claiver

So I'm caching the descriptions of games locally for faster loading and for most of the games I noticed a mediumtext field type works fine.

But there's some games out there with a big-ass description, such as World of Warcraft or Star Wars the Old Republic. The values of these descriptions were truncated in the database, resulting in the HTML being broken when displayed.

Now I have set the field type to longtext but the difference between mediumtext and longtext is incredibly big, look at these values:

mediumtext: 16777215 maximum characters

longtext: 4294967295 maximum characters (source)

How does one best go about solving this? Keeping it at longtext? Or is there another (better) way of achieving the saving of this data?

Avatar image for hadora
Hadora

4

Forum Posts

1

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#2  Edited By Hadora

Actually, even with long descriptions such as WoW's or Star Wars tOR, you are fine enough with a plain MEDIUMTEXT field (WoW's is ~120k chars long, less than 1% the max limit of MEDIUMTEXT). Are you sure the truncation comes from the length of the text, and not some form of unescaped strings you insert?

Avatar image for claiver
claiver

16

Forum Posts

14

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#3  Edited By claiver

Hm when I try it with MediumText my content is cut-off, but with a LongText it works just fine.. Any ideas?

Edit: Trying this again seems to have solved this for some mysterious reason ... !