reading large confluence page

hemaswapnika_e June 11, 2024

 

 

confluence.get_page_by_id(page_id, expand='body.storage') is not reading all the data if the confluence page is very large. (1500 KB)
How to handle reading of such large confluence pages?

2 answers

0 votes
hemaswapnika_e June 12, 2024

.

0 votes
Kristian Klima
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2024

Hi @hemaswapnika_e and welcome.

Here's a little trick that worked for me on multiple occasions.

  1. Divide the content of the supersized page into 2 or more parts.
  2. Create a single page for each of the said split parts. (Optionally, you can hide them outside of the page tree above the root page).
  3. On the page that you want to read, use the Page Include macros - one for each page with split content.
  4. Save the page. The content should display properly.

 

hemaswapnika_e June 12, 2024

Hi Kristian ,

1. On what basis we can split the page data. Do we have any limit parameter in confluence.get_page_by_id() method?

2. Once the page is splitted to multiple pages, where are they stored and how to read them?

3. Once the page is splitted to multiple pages, how to use the Page Include macros on these pages?

 

Kristian Klima
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2024

Don't think as a developer, think as a reader/user :)

You simply split the content manually.

So let's imagine that, on my supersized page A, I have three videos - V1, V2, V3.

Here's what I do:

  1. I create three pages - B, C, D.
  2. I put one video on each page - B=V1, C=V2, D=V3. Then I save the pages.
  3. On page A, with all videos deleted, I place three Page include macros - one for each page (B, C, D). I save the page A.

(you can move pages B, C, and D above the space's root page to ensure they're not visible in the tree)

I used this trick when the content was too big for Confluence to save or display. And our tools are able to 'read' included content. Your mileage may vary but it's worth trying because it should work.

hemaswapnika_e June 12, 2024

Could you pls share the code if possible

Kristian Klima
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2024

You don't need the code, you do it manually by creating pages in your space.

The whole preparation (splitting the content, creating new pages, inserting macros) is a GUI thing.

 

Once you have it all ready, you can see if your original method still runs into the page-too-large issue.

hemaswapnika_e June 12, 2024

I am currently working on a POC where i need to read all the confluence pages based on the confluence space key. I cant manually created sub pages during this process.

Is there any way we can split the supersized page into sub pages using atlassian-python-api library or any other approach?

Kristian Klima
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 12, 2024

"I am currently working on a POC where i need to read all the confluence pages based on the confluence space key."

Nothing should change, the page A will still be where it's now, it's just it would display content from different pages (from the programmatical point of view, it would link to the content from different pages).

Unless you're working with a specific set of pages.

We run a solution that works with pages from a specific space and we add new pages, we just 'refresh' the tool and it processes all the pages based on the space key.


If you don't want to create NEW pages, you can experiment with the existing pages - simply move the content (manually) from page X to page Y, save Y, put the include macro in page X. If you can verify, that your POC processes page X as if it actually featured the content, you'll have your proof.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events