question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: add ability for routing integrations to not cache views

See original GitHub issue

Bug Report

Ionic version:

[x] 4.x

Current behavior:

It looks like the back button does not show up in some cases when it should. This happens if one page gets opened a second time.

Possibly pages get initialized without ‘can-go-back’ and this does not get updated.

Wrong behavior: My app opens a “list page” which can open a “detail page” which can open the “list page” with other query params again. This “list page” does not show an ionic-back-button.

Expected behavior:

I would expect the ionic-back-button to show on the last “list page” and take me back to the “detail page” and from there another ionic-back-button to the first “list page”.

Steps to reproduce:

  • Start app on home page
  • Click on button on homepage at the bottom “LIST”
  • Navigated to ListPage
  • Click on “Item 1”
  • Navigated to Homepage -> There is no back button

If I use the list page from menu, the back-button will show on the home page. But if I go to the list page again from there, the button will disappear as well.

Related code:

This is my test case.

Other information:

Ionic info:

New menu template

Ionic:

   Ionic CLI                     : 5.4.1 (/Users/gedysintraware/.nvm/versions/node/v10.13.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.10.0
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.0.0

Utility:

   cordova-res : 0.6.0 
   native-run  : 0.2.8 

System:

   NodeJS : v10.13.0 (/Users/gedysintraware/.nvm/versions/node/v10.13.0/bin/node)
   npm    : 6.4.1
   OS     : macOS Mojave

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
marcoromagcommented, Oct 2, 2019

same happens with React apps

1reaction
liamdebeasicommented, Oct 30, 2020

Thanks for the issue. By default, all of our routing integrations will re-use existing views if they match the same URL. For example:

/a --> /b --> /a would re-use the rendered view for /a and ion-back-button would not appear since it is on the root view.

While this is working as intended, I can understand that this may not be expected or desirable in some situations. Changing this would be a breaking change that we can look into, or we can look into making this an opt-in feature. Either way there is certainly going to need to be some discussion about how to implement this.

For anyone who is running into this scenario: Would you be able to provide a use case and a code sample that can help us understand how this behavior affects your applications? Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial for using feature flags in a .NET Core app
NET Core library offers out-of-the-box integrations, including MVC controller actions, views, routes, and middleware. The Add feature flags ...
Read more >
long2ice/fastapi-cache - GitHub
Support redis , memcache , dynamodb , and in-memory backends. Easily integration with fastapi . Support http cache like ETag and Cache-Control ....
Read more >
Enabling API caching to enhance responsiveness
You can enable API caching in Amazon API Gateway to cache your endpoint's responses. With caching, you can reduce the number of calls...
Read more >
Caching resources during runtime - Chrome Developers
In Workbox, you can handle runtime caching for assets using the workbox-routing module to match routes, and handle caching strategies for ...
Read more >
17 Methods to Optimize Laravel Performance - Kinsta
Route caching allows Laravel to retrieve routes periodically from the ... When utilizing Composer to install packages, use the --no-dev and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found