Skip to content

Conversation

koenpunt
Copy link
Collaborator

@koenpunt koenpunt commented Dec 4, 2014

Store a cached version of the model on first fetch, instead of create/update. Expire cache on create, update or delete.
This prevents caching of null values for columns with (dynamic) defaults in the database.

Todo:

  • Add test for using reload on cached model

@koenpunt koenpunt force-pushed the reverse-cache-read-write branch from 397f801 to 08c4927 Compare December 4, 2014 23:05
@koenpunt koenpunt force-pushed the reverse-cache-read-write branch from b368a77 to ff7974e Compare December 5, 2014 17:01
@koenpunt
Copy link
Collaborator Author

koenpunt commented Dec 6, 2014

@jpfuentes2 @cvanschalkwijk can you review this?

@Rican7
Copy link
Collaborator

Rican7 commented Dec 7, 2014

This makes sense to me. 👍

@koenpunt
Copy link
Collaborator Author

koenpunt commented Dec 7, 2014

This fixes a bug which has been introduced on master during the debates for 1.1/1.2 releases, so I think it's probably best to merge this in master as is.

@jpfuentes2
Copy link
Owner

I'm a fan, how about you @cvanschalkwijk ?

@koenpunt koenpunt mentioned this pull request Dec 8, 2014
@cvanschalkwijk
Copy link
Collaborator

Looks good. I would, I would like to start targeting pull requests into the releases so we can start including change logs. I would prefer to see this added to 1.1 or 1.2 instead of directly to master and we can start using the changelog again and get out of the habit of going straight into production.

cc #470

@koenpunt koenpunt merged commit 1031aae into jpfuentes2:master Jun 3, 2017
@koenpunt koenpunt deleted the reverse-cache-read-write branch June 3, 2017 11:49
AlexPerov pushed a commit to AlexPerov/php-activerecord that referenced this pull request Nov 20, 2019
* store cache on first fetch, expire on update

* update test to ensure cache update

* make sure model->reload does not use cached values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants