Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Volt cache for view fragments does not work in version 4.0.* #14907

Closed
brucelin opened this issue Mar 12, 2020 · 4 comments
Closed

[BUG]: Volt cache for view fragments does not work in version 4.0.* #14907

brucelin opened this issue Mar 12, 2020 · 4 comments
Assignees
Labels
bug A bug report status: low Low

Comments

@brucelin
Copy link

brucelin commented Mar 12, 2020

Volt cache for view fragments does not work in version 4.0.*

When i try to cache the view fragments

{% cache 'sidebar' 3600 %}
    <!-- ... -->
{% endcache %}

It throw the error

Phalcon\Di\Exception : Service 'viewCache' wasn't found in the dependency injection container

Then I registered the viewCache service in the Di container with a redis adapter. But it throw the error

Uncaught Error: Call to undefined method Phalcon\Cache\Adapter\Redis::start()

Did I miss some config or this functionality of volt cache has been removed in version 4.0.* ?

@brucelin brucelin added bug A bug report status: unverified Unverified labels Mar 12, 2020
@Jeckerson
Copy link
Member

Show how do you declare viewCache service, please.

@niden
Copy link
Member

niden commented Mar 13, 2020

@brucelin You are correct. the viewCache has been removed from v4 because the cache service was incompatible with the old cache/viewCache.

Actually you found an area where we missed removing the service so thanks for that - it will be sorted out shortly.

You can use services such as varnish, cloudflare etc. to cache pages as an alternative. For fragments you can always use the render() from the Simple view or you can use the new toString() method from the View.

@niden niden added 4.0.6 status: low Low and removed status: unverified Unverified labels Mar 13, 2020
@niden niden mentioned this issue Mar 13, 2020
5 tasks
@niden niden self-assigned this Mar 13, 2020
niden added a commit that referenced this issue Mar 13, 2020
@niden
Copy link
Member

niden commented Mar 13, 2020

Resolved in #14914

@niden niden closed this as completed Mar 13, 2020
niden added a commit that referenced this issue Mar 20, 2020
* '4.0.x' of github.com:phalcon/cphalcon: (62 commits)
  [#13655] - Added more tests
  [#13655] - Added one more test for get/set
  [#13655] - Hangout test!!
  [4.0.x] - Minor refector
  [4.0.x] - Correcting test
  [4.0.x] - Minor correction
  [4.0.x] - Updated Request tests
  [#14639] - Added test for model paginate
  [#14639] - Trying phpunit 8.5
  [#14639] - Removed sqlite from test
  [#14639] - Added test
  [#14907] - Updated changelog
  [#14907] - Removed cache parsing from Volt
  [#14912] - Updated changelog [ci-skip]
  [#14912] - Updated changelog
  [#14912] - Removed iconv from Volt::convertEncoding
  Deleted Makefile
  [#14866] - Enabling tests
  [#14866] - Updated changelog
  [#14866] - Changed the friendlyTitle to not rely on iconv
  ...
niden added a commit that referenced this issue May 16, 2020
@mahen3d
Copy link

mahen3d commented Nov 13, 2020

"You can use services such as varnish, cloudflare etc. to cache pages as an alternative." this is very bad solution, i too have the same issue, how can you just remove cache from the templating service and say to use "cloudflare" ... :(

@niden niden moved this to Released in Phalcon v5 Aug 25, 2022
@niden niden added this to Phalcon v5 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: low Low
Projects
Archived in project
Development

No branches or pull requests

4 participants