1

worth the set cache html code or just mysql (serialize)?

the full HTML should reduce load time without re-implementation of the php script if I'm wrong. Do you know of some other disadvantages?

//Use html to serialize cache or another option?

1
  • cache invalidation is really not trivial task. Commented Mar 2, 2012 at 14:17

3 Answers 3

2

Nothing is faster than plain HTML pages, so go for both cache solutions. But as Alfred said, you should use APC instead of MySQL as serialized cache. Also, you should take advantage of the MySQL query cache.

Further on, checkout memcached and/or Redis as alternative for storing values which need to be stored and retrieved very often.

EDIT: Just another idea to gain more performance - store your HTML files using a tmpfs (RAM based) filesystem. If something is faster than pure HTML files, then it can only be pure HTML files served via RAM disk. ;)

Sign up to request clarification or add additional context in comments.

2 Comments

I have written custom code to cache the files, only to decide whether to review and I do not use another option. Needs fast cache queries or complete html code.
Then just put the files onto a RAM disk (tmpfs). Cannot be faster.
2

Use both. HTML caching is critical in high-volume PHP sites.

Comments

0

You should set expire headers on all your assets. Furthermore if possible use APC instead of mysql cache. If not possible to use APC, then you could use MySQL query cache like you said(I assume you meant this), but it is not as solid as APC.

2 Comments

APC is faster than the file cache?
it is, because then you will avoid disc io. APC uses RAM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.