: What type of websites shouldn't use a cache? Is there ever a time when you should use caching? Like for frequently updated pages? Or, should you always cache? Please give examples and reason?
Is there ever a time when you should use caching? Like for frequently updated pages? Or, should you always cache?
Please give examples and reason?
More posts by @Bryan171
2 Comments
Sorted by latest first Latest Oldest Best
Guess it depends on what you mean by cache.
Database query caching - in many cases it makes sense to cache queries in memcached or even serialized to disk
Page fragment caching - if you have portions of your page that are semi-dynamic, it can sometimes make sense to persist those to memory or disk rather than having to re-generate them on every page load
Reverse proxy - an intelligent (or not-so-intelligent) layer that stores snapshots of your fully rendered pages and presents these as static pages to the client based on strategies you set.
Client side caching - through the intelligent choice of Expires and other HTTP headers, you can ensure that your clients only request files from your site as needed
All of these play a role in site optimization, and use is determined by how dynamic your data is, whether the client is logged in, and countless other factors. The simple answer is to cache wherever you can, at the level which consumes the fewest resources, without compromising user experience.
I'm assuming you meant 'shouldn't use caching?' otherwise you should really always use caching for pages that need it. (lots of server side rendering and sql...).
A cache is used to send out pre-rendered pages opposed doing the logic and the database queries for every single request. drasticly speeds up everything. An option is to just clear the cache more often.. not necisarily turn if off.
There are times where you want no cache.. like an admin panel or something that has to be updated immedietly, every time.
A cache should be used for pages:
that don't change a lot or have to be constantly parsed by php
if there as a lot of work to render the page like database calls or a lot of utilitly scripts.
if it is requested a lot. like a home page.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.