Closed alandefreitas closed 1 year ago
We're pulling our content from the revsys.boost.dev
bucket only FYI
In the revsys.boost.dev
bucket we have:
cppalliance/site-docs
pushing main docs to site-docs/{ref_name}
(ref)cppalliance/boost
pushing library docs to site/{ref_name}
(ref)To be specific, since https://www.boost.revsys.dev/doc/user-guide/
has no ref_name
, where is this content coming from and how often is it pulled? It would be good to have an idea so we can also try to find out why the search bar isn't working.
Ah yeah I see why you're confused. We're rewriting the paths using the mapping in stage_static_config.json
So /doc/user-guide/
is coming from s3://boost.revsys.dev/site-docs/develop/user-guide/
specfically.
It pulls the files directly from S3 (not periodically) however it's cached and it seems the cache is set for a very long time (effectively infinite) @williln can you adjust the caching in StaticContentTemplateView
to be pull from a setting and have it default to 1 minute for now.
I don't have time to wait for infinite
You and me both my friend!
@frankwiles forcing the content type didn't seem to work.
This is a truncated example of what the cached value looks like (from inside the dev pod):
In [15]: static_cache.get("static_content_doc/user-guide/")
Out[15]:
(b'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="utf-8">\n <meta name="viewport" content="width=device-width,initial-scale=1">\n <title>User Guide :: Boost Site Docs</title>\n <link rel="canonical" href="https://antora.cppalliance.org/user-guide/index.html">\n
...
\n<script src="../_/js/search-ui.js" id="search-ui-script" data-site-root-path=".." data-snippet-length="100" data-stylesheet="../_/css/search.css"></script>\n<script async src="../search-index.js"></script>\n<script async src="../_/js/vendor/tabs.js" data-sync-storage-key="preferred-tab"></script>\n\n </body>\n</html>\n',
'text/html')
This is the bit that isn't loading: <script async src="../search-index.js">
. I'm not sure how all of this works behind the scenes -- is the problem that S3 is serving the HTML file and we just can't access the MIME type of the JS files that are being served as well? Here is the PR I merged: https://github.com/cppalliance/temp-site/pull/328
Leaving some notes here:
boto3
to hit the S3 bucket manually without the path translation and the JS file is coming back accurately when I access it individually: 'ContentType': 'application/javascript',
, 200 status code {'ResponseMetadata': {'RequestId': 'Q25RBRYKDP1G811B',
'HostId': '...',
'HTTPStatusCode': 200,
'HTTPHeaders': {'x-amz-id-2': '...',
'x-amz-request-id': '...',
'date': 'Thu, 11 May 2023 18:29:16 GMT',
'last-modified': 'Thu, 11 May 2023 02:40:22 GMT',
'etag': '"..."',
'x-amz-server-side-encryption': 'AES256',
'accept-ranges': 'bytes',
'content-type': 'application/javascript',
'server': 'AmazonS3',
'content-length': '969117'},
'RetryAttempts': 1},
'AcceptRanges': 'bytes',
'LastModified': datetime.datetime(2023, 5, 11, 2, 40, 22, tzinfo=tzutc()),
'ContentLength': 969117,
'ETag': '"..."',
'ContentType': 'application/javascript',
'ServerSideEncryption': 'AES256',
'Metadata': {},
'Body': <botocore.response.StreamingBody at 0x7f8a07d96c90>}
In [18]: key
Out[18]: 'site-docs/develop/search-index.js'
But hitting the URL locally does NOT work even with a direct path and returns a 404.
The search bar is disabled in pages like
https://www.boost.revsys.dev/doc/user-guide/
Maybe it's just out of date.
I don't know where the content comes from to boost.revsys.dev, but the docs are being sent to buckets from cppalliance/site-docs and cppalliance/boost. They work fine in the previews, for instance:
https://45.site-docs.prtest2.cppalliance.org/user-guide/index.html