Comments (9)
Thank you for your kind words.
could it be configured to have no cache for the users table, a 24-hour cache for the content table, and a one-month cache for the site_infos table ?
No, this is not supported (yet). Note that the cache only caches the structure and not the data.
Kindest regards Maurits
from php-crud-api.
Integrating support for TempFile cache for specific tables and responses would be a fantastic enhancement
And how would this improve performance measurably? Is your database remote and very slow?
from php-crud-api.
Since the read operations are HTTP GET requests, you could write a customizationHandler
that adds caching headers to the response. This could reduce the actual number of http requests. This would only help if your (ajax?) client would respect those headers. I think this could improve real world performance (at the cost of consistency).
NB: Next thing you'll be asking is implementing cache invalidation on write operations ;-) (joke, not serious)
NB2: Last comment is a reference to the 'hard things' in software engineering, see: https://martinfowler.com/bliki/TwoHardThings.html
from php-crud-api.
I'll re-open this issue if you actually use the software and have measurable performance problems. I can then help you to analyze and improve (real-world) performance.
from php-crud-api.
Thank you so much for your quick response! It's greatly appreciated.
Integrating support for TempFile cache for specific tables and responses would be a fantastic enhancement, potentially boosting the speed and efficiency of the apps using the API. I'm so grateful for your great work.
from php-crud-api.
In scenarios where we're building a flat CMS or dealing with content-heavy applications, and experiencing high traffic volumes, caching becomes especially valuable. Articles and static content, which don't change frequently, are prime candidates for caching to optimize performance. On the other hand, tables like comments and user data need to be updated more frequently to reflect real-time interactions and changes within the system.
By implementing a flexible caching mechanism that allows us to selectively cache specific tables, we can tailor the caching strategy to suit the needs of different types of data. This approach ensures that we strike the right balance between performance optimization and data freshness.
from php-crud-api.
In scenarios where we're building a flat CMS or dealing with content-heavy applications, and experiencing high traffic
As a performance engineer I'm very familiar with high traffic applications and static sites. Static site generators should pull the data in (right?), so caching in the API is not needed. Content heavy applications need a local database. With the current speed of disk drives the number of http requests seems more important to me than the number of queries. Especially when those queries are on the localhost and the http requests over the network. Thus my questions about the performance problems you are measuring.
this approach ensures that we strike the right balance between performance optimization and data freshness.
Caching hurts consistency and the acceptable trade-offs are very application specific and related to the bad performance (capacity and high traffic) of specific end-points. Even if we had a generic way to implement this I wouldn't know a generic way to configure this. I also (see point made above) doubt that you are caching at the right level (on a higher level would allow you to be more application/use-case specific).
from php-crud-api.
you could write a
customizationHandler
that adds caching headers to the response. This could reduce the actual number of http requests. This would only help if your (ajax?) client would respect those headers. I think this could improve real world performance (at the cost of consistency).
Could you please provide additional clarification on this matter?
NB: Next thing you'll be asking is implementing cache invalidation on write operations ;-) (joke, not serious)
Why not xD
NB2: Last comment is a reference to the 'hard things' in software engineering, see: https://martinfowler.com/bliki/TwoHardThings.html
That's quite impressive!
from php-crud-api.
Could you please provide additional clarification on this matter?
Sure, read more about HTTP caching here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching
Why not xD
Because it is hard (and therefor should be avoided, if possible).
from php-crud-api.
Related Issues (20)
- HTML Middleware HOT 2
- Update with "where" HOT 8
- "Request Tranformer" middleware HOT 2
- Azure App Service HOT 1
- Add PHP backend to any app project with one command HOT 1
- Any advice on events integration? HOT 2
- Synchronization between local IndexedDB and MySQL Database. HOT 3
- Question: Add property on create HOT 3
- Insights on caching with Redis HOT 2
- Using Customization handler to insert app-generated ID HOT 11
- PUT using curl comes back successful but the record is not actually updated HOT 2
- Suggestion to modify response JSON root Key (records) HOT 2
- firebase jwt public key rotation HOT 5
- "Route '' not found" HOT 3
- Additional SQL queries in authorization handlers HOT 2
- Direct usage of PHP CRUD API functions in external PHP Files HOT 8
- Failure on postgres when table name is domains HOT 10
- Returning user uploaded file using custom controller HOT 2
- Found this PDOException occurred (enable debug mode) in message HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-crud-api.